ports/devel/tclxml/files/patch-docObj.c
Pietro Cerutti af36765e17 devel/tclxml: fix build with libxml2 >= 2.12
Version 2.12 of libxml2 introduced a backwards incompatible change in
the signature of some functions, notably the second argument to
xmlStructuredErrorFunc has gained a const qualifier, changing from
`xmlError *error` to `const xmlError *error`.

To make the signatures compatible with both pre- and post-2.12, I have
introduced a check on LIBXML_VERSION.

PR:		279968
Reported by:    dizzy
2024-07-01 06:49:49 +00:00

19 lines
476 B
C

--- docObj.c.orig 2013-03-30 17:17:07 UTC
+++ docObj.c
@@ -1852,9 +1852,13 @@ void
}
void
-TclXML_libxml2_ErrorHandler (ctx, error)
- void *ctx; /* ignore - depends on context */
- xmlErrorPtr error;
+TclXML_libxml2_ErrorHandler (void *ctx,
+#if LIBXML_VERSION >= 21200
+ const xmlError *error
+#else
+ xmlError *error
+#endif
+ )
{
ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_Obj *objPtr;