From aa688c4388adbbbf022e0dbfad51e9a12eef37a1 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 11 Oct 2010 12:50:56 +0200 Subject: [PATCH] Allow compilation without Libxml2 support (again) --- src/solr.c | 4 ++-- src/zoom-sru.c | 4 ++++ util/yaz-record-conv.c | 12 +++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/solr.c b/src/solr.c index 8c1e29f..55a86ca 100644 --- a/src/solr.c +++ b/src/solr.c @@ -18,12 +18,12 @@ #include "sru-p.h" +#define SOLR_MAX_PARAMETERS 100 + #if YAZ_HAVE_XML2 #include #include -#define SOLR_MAX_PARAMETERS 100 - const char *xml_node_attribute_value_get(xmlNodePtr ptr, const char *node_name, const char *attribute_name) { struct _xmlAttr *attr; diff --git a/src/zoom-sru.c b/src/zoom-sru.c index bf00f61..c6d11e7 100644 --- a/src/zoom-sru.c +++ b/src/zoom-sru.c @@ -392,6 +392,7 @@ static void handle_srw_scan_response(ZOOM_connection c, int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres, zoom_ret *cret) { +#if YAZ_HAVE_XML2 int ret = 0; const char *addinfo = 0; @@ -446,6 +447,9 @@ int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres, ret = -1; } return ret; +#else + return -1; +#endif } /* diff --git a/util/yaz-record-conv.c b/util/yaz-record-conv.c index 4f943b6..d05ea11 100644 --- a/util/yaz-record-conv.c +++ b/util/yaz-record-conv.c @@ -7,6 +7,7 @@ #include #endif +#include #include #include @@ -30,6 +31,7 @@ int main (int argc, char **argv) case 'V': break; case 0: +#if YAZ_HAVE_XML2 if (!p) { xmlDocPtr doc = xmlParseFile(arg); @@ -92,11 +94,19 @@ int main (int argc, char **argv) fclose(f); } break; +#else + fprintf(stderr, "%s: YAZ not compiled with Libxml2 support\n", + prog); + usage(); + break; +#endif default: usage(); } - } + } +#if YAZ_HAVE_XML2 yaz_record_conv_destroy(p); +#endif if (no_errors) exit(1); exit(0); -- 1.7.10.4