X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Flibxml2_error.c;h=d7abcf84ec13551209ddeb39bc1a759c79d5068f;hb=50606c10e645308dddb9c8d0e676b33ce38f1df8;hp=41d9284297ac59b47e7a9715b7896680fbbba75e;hpb=ee6ab2ee3a9ee1a8c65d7272ec7fba1d886f5af0;p=yaz-moved-to-github.git diff --git a/src/libxml2_error.c b/src/libxml2_error.c index 41d9284..d7abcf8 100644 --- a/src/libxml2_error.c +++ b/src/libxml2_error.c @@ -23,6 +23,7 @@ static int libxml2_error_level = 0; +#if YAZ_HAVE_XML2 static void proxy_xml_error_handler(void *ctx, const char *fmt, ...) { char buf[1024]; @@ -35,15 +36,16 @@ static void proxy_xml_error_handler(void *ctx, const char *fmt, ...) va_end (ap); } +#endif int libxml2_error_to_yazlog(int level, const char *lead_msg) { libxml2_error_level = level; +#if YAZ_HAVE_XML2 + xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler); #if YAZ_HAVE_XSLT xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler); #endif -#if YAZ_HAVE_XML2 - xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler); return 0; #else return -1;