From 59781974d3195f660f3639df6c161cb23bbe33e4 Mon Sep 17 00:00:00 2001 From: short <> Date: Sat, 16 Aug 2003 14:30:18 +0000 Subject: [PATCH] Prevent inclusion of if libxml2 is too old. - We have no use for xmlreader without working libxml buffering of 2.5.9. --- configure.in | 5 +++++ src/libcaptive/client/giochannel-blind.c | 7 +++++-- src/libcaptive/client/giochannel-blind.h | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 08ee8be..73f8e60 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/src/libcaptive/client/giochannel-blind.c b/src/libcaptive/client/giochannel-blind.c index b591702..ec70029 100644 --- a/src/libcaptive/client/giochannel-blind.c +++ b/src/libcaptive/client/giochannel-blind.c @@ -28,9 +28,11 @@ #include #include #include -#include #include "captive/libxml.h" #include +#ifdef HAVE_LIBXML_BUFFERING +#include +#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 */ diff --git a/src/libcaptive/client/giochannel-blind.h b/src/libcaptive/client/giochannel-blind.h index cbdbeae..6ae610d 100644 --- a/src/libcaptive/client/giochannel-blind.h +++ b/src/libcaptive/client/giochannel-blind.h @@ -23,7 +23,9 @@ #include #include +#ifdef HAVE_LIBXML_BUFFERING #include +#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 -- 1.8.3.1