45 lines
1.7 KiB
Diff
45 lines
1.7 KiB
Diff
From befb52ff36b58582c8afb262041eeab718f6a013 Mon Sep 17 00:00:00 2001
|
|
From: desert-sailor <dongxing.wang_a@thundersoft.com>
|
|
Date: Fri, 22 Mar 2024 10:08:42 +0800
|
|
Subject: [PATCH 1/2] Fix build error with libxml2 2.12
|
|
|
|
---
|
|
gcore/gdaljp2metadatagenerator.cpp | 7 ++++++-
|
|
port/cpl_xml_validate.cpp | 2 +-
|
|
2 files changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/gcore/gdaljp2metadatagenerator.cpp b/gcore/gdaljp2metadatagenerator.cpp
|
|
index b6caa2d..751fa3d 100644
|
|
--- a/gcore/gdaljp2metadatagenerator.cpp
|
|
+++ b/gcore/gdaljp2metadatagenerator.cpp
|
|
@@ -357,7 +357,12 @@ static CPLString GDALGMLJP2EvalExpr(const CPLString &osTemplate,
|
|
/************************************************************************/
|
|
|
|
static void GDALGMLJP2XPathErrorHandler(void * /* userData */,
|
|
- xmlErrorPtr error)
|
|
+#if LIBXML_VERSION >= 21200
|
|
+ const xmlError *error
|
|
+#else
|
|
+ xmlErrorPtr error
|
|
+#endif
|
|
+)
|
|
{
|
|
if (error->domain == XML_FROM_XPATH && error->str1 != nullptr &&
|
|
error->int1 < static_cast<int>(strlen(error->str1)))
|
|
diff --git a/port/cpl_xml_validate.cpp b/port/cpl_xml_validate.cpp
|
|
index 7eb49ff..29070d9 100644
|
|
--- a/port/cpl_xml_validate.cpp
|
|
+++ b/port/cpl_xml_validate.cpp
|
|
@@ -914,7 +914,7 @@ static void CPLLibXMLWarningErrorCallback(void *ctx, const char *msg, ...)
|
|
|
|
if (strstr(pszStr, "since this namespace was already imported") == nullptr)
|
|
{
|
|
- xmlErrorPtr pErrorPtr = xmlGetLastError();
|
|
+ const xmlError *pErrorPtr = xmlGetLastError();
|
|
const char *pszFilename = static_cast<char *>(ctx);
|
|
char *pszStrDup = CPLStrdup(pszStr);
|
|
int nLen = static_cast<int>(strlen(pszStrDup));
|
|
--
|
|
2.43.0
|
|
|