diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-08-17 00:05:33 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-08-17 00:05:33 -0400 |
commit | 33f40976a716287ecddfb01f446797d8df215125 (patch) | |
tree | bd91603a51ad92145a9fac10341f9b10d9c8f8c0 /src | |
parent | 26893906896d25b0119c57c90474c153bb8083c9 (diff) | |
download | postgresql-33f40976a716287ecddfb01f446797d8df215125.tar.gz postgresql-33f40976a716287ecddfb01f446797d8df215125.zip |
Check LIBXML_VERSION instead of testing in configure script.
We had put a test for libxml2's xmlStructuredErrorContext variable in
configure, but of course that doesn't work on Windows builds. The next
best alternative seems to be to test the LIBXML_VERSION symbol provided
by xmlversion.h.
Per report from Talha Bin Rizwan, though this fixes it in a different way
than his proposed patch.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/adt/xml.c | 12 | ||||
-rw-r--r-- | src/include/pg_config.h.in | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 588eb3d0a35..1f083479f72 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -52,9 +52,19 @@ #include <libxml/tree.h> #include <libxml/uri.h> #include <libxml/xmlerror.h> +#include <libxml/xmlversion.h> #include <libxml/xmlwriter.h> #include <libxml/xpath.h> #include <libxml/xpathInternals.h> + +/* + * We used to check for xmlStructuredErrorContext via a configure test; but + * that doesn't work on Windows, so instead use this grottier method of + * testing the library version number. + */ +#if LIBXML_VERSION >= 20704 +#define HAVE_XMLSTRUCTUREDERRORCONTEXT 1 +#endif #endif /* USE_LIBXML */ #include "catalog/namespace.h" @@ -970,7 +980,7 @@ pg_xml_init(PgXmlStrictness strictness) * * The only known situation in which this test fails is if we compile with * headers from a libxml2 that doesn't track the structured error context - * separately (<= 2.7.3), but at runtime use a version that does, or vice + * separately (< 2.7.4), but at runtime use a version that does, or vice * versa. The libxml2 authors did not treat that change as constituting * an ABI break, so the LIBXML_TEST_VERSION test in pg_xml_init_library * fails to protect us from this. diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 5454efdcbe6..8430608bfc8 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -632,9 +632,6 @@ /* Define to 1 if you have the <winldap.h> header file. */ #undef HAVE_WINLDAP_H -/* Define to 1 if your libxml has xmlStructuredErrorContext. */ -#undef HAVE_XMLSTRUCTUREDERRORCONTEXT - /* Define to the appropriate snprintf format for 64-bit ints. */ #undef INT64_FORMAT |