Prevent inclusion of <libxml/xmlreader.h> if libxml2 is too old.
authorshort <>
Sat, 16 Aug 2003 14:30:18 +0000 (14:30 +0000)
committershort <>
Sat, 16 Aug 2003 14:30:18 +0000 (14:30 +0000)
 - We have no use for xmlreader without working libxml buffering of 2.5.9.

configure.in
src/libcaptive/client/giochannel-blind.c
src/libcaptive/client/giochannel-blind.h

index 08ee8be..73f8e60 100644 (file)
@@ -206,7 +206,12 @@ PKG_CHECK_MODULES(LIBXML,libxml-2.0 >= 2.5.9,[ have_libxml_buffering=true ],[
        dnl Disable bug-replay(1) build if not met; --bug-pathname would be still OK.
        PKG_CHECK_MODULES(LIBXML,libxml-2.0,[ have_libxml_buffering=false ])
        ])
+dnl We also condition 'HAVE_LIBXML_XMLREADER_H' by 'HAVE_LIBXML_BUFFERING'
+dnl as we have no use for xmlreader without working libxml buffering of 2.5.9.
 AM_CONDITIONAL(HAVE_LIBXML_BUFFERING,$have_libxml_buffering)
+if $have_libxml_buffering;then
+       AC_DEFINE(HAVE_LIBXML_BUFFERING,,[libxml2 correctly reads textnodes by its xmlTextReader.])
+fi
 AC_SUBST(LIBXML_CFLAGS)
 AC_SUBST(LIBXML_LIBS)
 
index b591702..ec70029 100644 (file)
 #include <openssl/bn.h>
 #include <openssl/crypto.h>
 #include <libxml/tree.h>
-#include <libxml/xmlreader.h>
 #include "captive/libxml.h"
 #include <ctype.h>
+#ifdef HAVE_LIBXML_BUFFERING
+#include <libxml/xmlreader.h>
+#endif
 
 
 /* CONFIG: */
@@ -690,7 +692,7 @@ gchar hex_out[0
        return xml_media;
 }
 
-
+#ifdef HAVE_LIBXML_BUFFERING
 struct captive_giochannel_blind *captive_giochannel_blind_new_from_xml(xmlTextReader *xml_reader)
 {
 struct captive_giochannel_blind *r;
@@ -806,3 +808,4 @@ const xmlChar *xml_name;
 
        return r;
 }
+#endif /* HAVE_LIBXML_BUFFERING */
index cbdbeae..6ae610d 100644 (file)
@@ -23,7 +23,9 @@
 
 #include <glib/giochannel.h>
 #include <libxml/tree.h>
+#ifdef HAVE_LIBXML_BUFFERING
 #include <libxml/xmlreader.h>
+#endif
 
 
 G_BEGIN_DECLS
@@ -34,8 +36,10 @@ struct captive_giochannel_blind *captive_giochannel_blind_new(GIOChannel *giocha
 gboolean captive_giochannel_blind_get_size(GIOChannel *giochannel,guint64 *size_return);
 GIOStatus captive_giochannel_blind_commit(GIOChannel *giochannel_blind);
 xmlNode *captive_giochannel_blind_readreport_to_xml(xmlNode *xml_parent,GIOChannel *giochannel);
-struct captive_giochannel_blind *captive_giochannel_blind_new_from_xml(xmlTextReader *xml_reader);
 void captive_giochannel_setup(GIOChannel *giochannel);
+#ifdef HAVE_LIBXML_BUFFERING
+struct captive_giochannel_blind *captive_giochannel_blind_new_from_xml(xmlTextReader *xml_reader);
+#endif
 
 G_END_DECLS