Skip to content

Commit

Permalink
Cherry-pick 270977@main (1bad176). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=265128

    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
  • Loading branch information
aperezdc committed Nov 21, 2023
1 parent 10543a8 commit 209457c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WebCore/xml/XSLTProcessor.h
Expand Up @@ -61,7 +61,11 @@ class XSLTProcessor : public RefCounted<XSLTProcessor> {

void reset();

#if LIBXML_VERSION >= 21200
static void parseErrorFunc(void* userData, const xmlError*);
#else
static void parseErrorFunc(void* userData, xmlError*);
#endif
static void genericErrorFunc(void* userData, const char* msg, ...);

// Only for libXSLT callbacks
Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/xml/XSLTProcessorLibxslt.cpp
Expand Up @@ -59,7 +59,11 @@ void XSLTProcessor::genericErrorFunc(void*, const char*, ...)
// It would be nice to do something with this error message.
}

#if LIBXML_VERSION >= 21200
void XSLTProcessor::parseErrorFunc(void* userData, const xmlError* error)
#else
void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error)
#endif
{
PageConsoleClient* console = static_cast<PageConsoleClient*>(userData);
if (!console)
Expand Down

0 comments on commit 209457c

Please sign in to comment.