|
35 | 35 | #include <libxml/xpath.h> |
36 | 36 | #include <libxml/xpathInternals.h> |
37 | 37 |
|
| 38 | +#if !(defined(LIBXML_VERSION) && LIBXML_VERSION >= 21400) |
| 39 | +// Cf https://gitlab.gnome.org/GNOME/libxml2/-/commit/92d7b0cd909beb61cd90d9746964f303eab36d78 |
| 40 | +#define xmlXPathValuePush valuePush |
| 41 | +#define xmlXPathValuePop valuePop |
| 42 | +#endif |
| 43 | + |
38 | 44 | #ifdef __clang__ |
39 | 45 | #pragma clang diagnostic pop |
40 | 46 | #endif |
@@ -401,20 +407,20 @@ static void GDALGMLJP2XPathIf(xmlXPathParserContextPtr ctxt, int nargs) |
401 | 407 | xmlXPathObjectPtr cond_val, then_val, else_val; |
402 | 408 |
|
403 | 409 | CHECK_ARITY(3); |
404 | | - else_val = valuePop(ctxt); |
405 | | - then_val = valuePop(ctxt); |
| 410 | + else_val = xmlXPathValuePop(ctxt); |
| 411 | + then_val = xmlXPathValuePop(ctxt); |
406 | 412 | CAST_TO_BOOLEAN |
407 | | - cond_val = valuePop(ctxt); |
| 413 | + cond_val = xmlXPathValuePop(ctxt); |
408 | 414 |
|
409 | 415 | if (cond_val->boolval) |
410 | 416 | { |
411 | 417 | xmlXPathFreeObject(else_val); |
412 | | - valuePush(ctxt, then_val); |
| 418 | + xmlXPathValuePush(ctxt, then_val); |
413 | 419 | } |
414 | 420 | else |
415 | 421 | { |
416 | 422 | xmlXPathFreeObject(then_val); |
417 | | - valuePush(ctxt, else_val); |
| 423 | + xmlXPathValuePush(ctxt, else_val); |
418 | 424 | } |
419 | 425 | xmlXPathFreeObject(cond_val); |
420 | 426 | } |
@@ -460,8 +466,8 @@ static void GDALGMLJP2XPathUUID(xmlXPathParserContextPtr ctxt, int nargs) |
460 | 466 | osRet += GDALGMLJP2HexFormatter(fakeRand() & 0xFF); |
461 | 467 | } |
462 | 468 |
|
463 | | - valuePush(ctxt, xmlXPathNewString( |
464 | | - reinterpret_cast<const xmlChar *>(osRet.c_str()))); |
| 469 | + xmlXPathValuePush(ctxt, xmlXPathNewString(reinterpret_cast<const xmlChar *>( |
| 470 | + osRet.c_str()))); |
465 | 471 | } |
466 | 472 |
|
467 | 473 | #endif // LIBXML2 |
|
0 commit comments