2
1

0008-Build-fails-with-libxml2-version-2.12.0-due-to-API-c.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From df49bfc4c93001970c9b9266903ee7e8804fb576 Mon Sep 17 00:00:00 2001
  2. From: Adrian Perez de Castro <aperez@igalia.com>
  3. Date: Mon, 20 Nov 2023 07:42:30 -0800
  4. Subject: [PATCH] Build fails with libxml2 version 2.12.0 due to API change
  5. https://bugs.webkit.org/show_bug.cgi?id=265128
  6. Reviewed by Philippe Normand.
  7. Starting with libxml2 2.12.0, the API has changed the const-ness of the
  8. xmlError pointers, which results in a build error due to a mismatched
  9. type in the parsing error callback. This papers over the difference by
  10. using preprocessor conditionals.
  11. * Source/WebCore/xml/XSLTProcessor.h: Use const when building against
  12. libxml2 2.12.0 or newer.
  13. * Source/WebCore/xml/XSLTProcessorLibxslt.cpp:
  14. (WebCore::XSLTProcessor::parseErrorFunc): Ditto.
  15. Canonical link: https://commits.webkit.org/270977@main
  16. Upstream: https://github.com/WebKit/WebKit/commit/1bad176b2496579d760852c80cff3ad9fb7c3a4b
  17. Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
  18. ---
  19. Source/WebCore/xml/XSLTProcessor.h | 4 ++++
  20. Source/WebCore/xml/XSLTProcessorLibxslt.cpp | 4 ++++
  21. 2 files changed, 8 insertions(+)
  22. diff --git a/Source/WebCore/xml/XSLTProcessor.h b/Source/WebCore/xml/XSLTProcessor.h
  23. index 21bb45b5cbe1..5cf20557918f 100644
  24. --- a/Source/WebCore/xml/XSLTProcessor.h
  25. +++ b/Source/WebCore/xml/XSLTProcessor.h
  26. @@ -61,7 +61,11 @@ public:
  27. void reset();
  28. +#if LIBXML_VERSION >= 21200
  29. + static void parseErrorFunc(void* userData, const xmlError*);
  30. +#else
  31. static void parseErrorFunc(void* userData, xmlError*);
  32. +#endif
  33. static void genericErrorFunc(void* userData, const char* msg, ...);
  34. // Only for libXSLT callbacks
  35. diff --git a/Source/WebCore/xml/XSLTProcessorLibxslt.cpp b/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
  36. index a65691087e3c..9f6b363dfc6c 100644
  37. --- a/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
  38. +++ b/Source/WebCore/xml/XSLTProcessorLibxslt.cpp
  39. @@ -59,7 +59,11 @@ void XSLTProcessor::genericErrorFunc(void*, const char*, ...)
  40. // It would be nice to do something with this error message.
  41. }
  42. +#if LIBXML_VERSION >= 21200
  43. +void XSLTProcessor::parseErrorFunc(void* userData, const xmlError* error)
  44. +#else
  45. void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error)
  46. +#endif
  47. {
  48. PageConsoleClient* console = static_cast<PageConsoleClient*>(userData);
  49. if (!console)
  50. --
  51. 2.43.1