diff --git a/acconfig.h b/acconfig.h index 72840aec87..1383bac9eb 100644 --- a/acconfig.h +++ b/acconfig.h @@ -91,7 +91,6 @@ /*** End i18n ***/ -#undef GNOME_XML_HEADER_VERSION_1 -#undef GNOME_XML_HEADER_VERSION_2 +#undef HAVE_XML_VERSION_HEADER #endif diff --git a/configure.in b/configure.in index ef9efefbd8..d27fad376c 100644 --- a/configure.in +++ b/configure.in @@ -60,13 +60,9 @@ GNOME_CHECK_GUILE GNOME_PRINT_CHECK GNOME_XML_CHECK -AC_CHECK_HEADER(gnome-xml/parserInternals.h, [ - GNOME_XML_HEADER_VERSION_1=1 - AC_DEFINE(GNOME_XML_HEADER_VERSION_1) -]) -AC_CHECK_HEADER(libxml/parserInternals.h, [ - GNOME_XML_HEADER_VERSION_2=1 - AC_DEFINE(GNOME_XML_HEADER_VERSION_2) +AC_CHECK_HEADER(libxml/xmlversion.h, [ + HAVE_XML_VERSION_HEADER=1 + AC_DEFINE(HAVE_XML_VERSION_HEADER) ]) dnl Set of available languages. diff --git a/src/engine/io-gncxml-r.c b/src/engine/io-gncxml-r.c index 14446a724c..7ce8844b92 100644 --- a/src/engine/io-gncxml-r.c +++ b/src/engine/io-gncxml-r.c @@ -23,16 +23,32 @@ #include -#ifdef GNOME_XML_HEADER_VERSION_1 -#include -#include -#include -#include -#elif defined(GNOME_XML_HEADER_VERSION_2) +#ifdef HAVE_XML_VERSION_HEADER +#include +#endif + +#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000 + #include #include #include #include +#ifndef xmlChildrenNode +#define xmlChildrenNode children +#define xmlRootNode children +#endif + +#else + +#include +#include +#include +#include +#ifndef xmlChildrenNode +#define xmlChildrenNode childs +#define xmlRootNode root +#endif + #endif #include "Account.h" diff --git a/src/engine/io-gncxml-w.c b/src/engine/io-gncxml-w.c index c6f690f82f..81518e25ad 100644 --- a/src/engine/io-gncxml-w.c +++ b/src/engine/io-gncxml-w.c @@ -49,16 +49,32 @@ #include #include -#ifdef GNOME_XML_HEADER_VERSION_1 -#include -#include -#include -#include -#elif defined(GNOME_XML_HEADER_VERSION_2) +#ifdef HAVE_XML_VERSION_HEADER +#include +#endif + +#if defined(LIBXML_VERSION) && LIBXML_VERSION >= 20000 + #include #include #include #include +#ifndef xmlChildrenNode +#define xmlChildrenNode children +#define xmlRootNode children +#endif + +#else + +#include +#include +#include +#include +#ifndef xmlChildrenNode +#define xmlChildrenNode childs +#define xmlRootNode root +#endif + #endif #include "Account.h" @@ -85,10 +101,6 @@ static short module = MOD_IO; /* Pulled from the libxml-1.8.8 header */ -#ifndef xmlChildrenNode -#define xmlChildrenNode childs -#define xmlRootNode root -#endif static const gchar *gncxml_emacs_trailer = "\n"