0010-Fix-building-with-system-libxml2.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 67ceca4b097a2d3de28020c9461641d9670009cc Mon Sep 17 00:00:00 2001
  2. From: Martin Negyokru <negyokru@inf.u-szeged.hu>
  3. Date: Thu, 7 Dec 2023 15:37:53 +0100
  4. Subject: [PATCH] Fix building with system libxml2
  5. Libxml2 2.12.0 has changed the const-ness of the
  6. xmlError pointers, which results in a build error.
  7. Change-Id: Id86fcfbfe004f89109808b9bdb11c01133553884
  8. Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/523633
  9. Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
  10. (cherry picked from commit 159dff274a7f32f9b53711df6a5b6fbae8c64b4a)
  11. Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/525714
  12. Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
  13. Upstream: https://github.com/qt/qtwebengine-chromium/commit/c98d28f2f0f23721
  14. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  15. ---
  16. .../third_party/blink/renderer/core/xml/xslt_processor.h | 5 +++++
  17. .../blink/renderer/core/xml/xslt_processor_libxslt.cc | 4 ++++
  18. 2 files changed, 9 insertions(+)
  19. diff --git a/chromium/third_party/blink/renderer/core/xml/xslt_processor.h b/chromium/third_party/blink/renderer/core/xml/xslt_processor.h
  20. index e501cf17c37..e4550ec5009 100644
  21. --- a/chromium/third_party/blink/renderer/core/xml/xslt_processor.h
  22. +++ b/chromium/third_party/blink/renderer/core/xml/xslt_processor.h
  23. @@ -79,7 +79,12 @@ class XSLTProcessor final : public ScriptWrappable {
  24. void reset();
  25. +#if LIBXML_VERSION >= 21200
  26. + static void ParseErrorFunc(void* user_data, const xmlError*);
  27. +#else
  28. static void ParseErrorFunc(void* user_data, xmlError*);
  29. +#endif
  30. +
  31. static void GenericErrorFunc(void* user_data, const char* msg, ...);
  32. // Only for libXSLT callbacks
  33. diff --git a/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc b/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc
  34. index b3ce345f320..2174d1df1da 100644
  35. --- a/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc
  36. +++ b/chromium/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc
  37. @@ -60,7 +60,11 @@ void XSLTProcessor::GenericErrorFunc(void*, const char*, ...) {
  38. // It would be nice to do something with this error message.
  39. }
  40. +#if LIBXML_VERSION >= 21200
  41. +void XSLTProcessor::ParseErrorFunc(void* user_data, const xmlError* error) {
  42. +#else
  43. void XSLTProcessor::ParseErrorFunc(void* user_data, xmlError* error) {
  44. +#endif
  45. FrameConsole* console = static_cast<FrameConsole*>(user_data);
  46. if (!console)
  47. return;
  48. --
  49. 2.25.1