Skip to content

Commit 2c9d24b

Browse files
aperezdcphiln
authored andcommitted
Build fails with libxml2 version 2.12.0 due to API change
https://bugs.webkit.org/show_bug.cgi?id=265128 Reviewed by Philippe Normand. Starting with libxml2 2.12.0, the API has changed the const-ness of the xmlError pointers, which results in a build error due to a mismatched type in the parsing error callback. This papers over the difference by using preprocessor conditionals. * Source/WebCore/xml/XSLTProcessor.h: Use const when building against libxml2 2.12.0 or newer. * Source/WebCore/xml/XSLTProcessorLibxslt.cpp: (WebCore::XSLTProcessor::parseErrorFunc): Ditto. Canonical link: https://commits.webkit.org/270977@main
1 parent 5f519ff commit 2c9d24b

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

Source/WebCore/xml/XSLTProcessor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ class XSLTProcessor : public RefCounted<XSLTProcessor> {
6161

6262
void reset();
6363

64+
#if LIBXML_VERSION >= 21200
65+
static void parseErrorFunc(void* userData, const xmlError*);
66+
#else
6467
static void parseErrorFunc(void* userData, xmlError*);
68+
#endif
6569
static void genericErrorFunc(void* userData, const char* msg, ...);
6670

6771
// Only for libXSLT callbacks

Source/WebCore/xml/XSLTProcessorLibxslt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ void XSLTProcessor::genericErrorFunc(void*, const char*, ...)
6262
// It would be nice to do something with this error message.
6363
}
6464

65+
#if LIBXML_VERSION >= 21200
66+
void XSLTProcessor::parseErrorFunc(void* userData, const xmlError* error)
67+
#else
6568
void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error)
69+
#endif
6670
{
6771
PageConsoleClient* console = static_cast<PageConsoleClient*>(userData);
6872
if (!console)

0 commit comments

Comments
 (0)