From bad730dd0de24b2b17b91922c0c7f2b31b7b4d9b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Jan 2012 18:43:15 +0300 Subject: Move libxml2 includes to xml.h --- src/utils/xml.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/utils/xml.cpp') diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 87833d176..5a9558cc2 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -32,6 +32,11 @@ #include "debug.h" +static void xmlNullLogger(void *ctx A_UNUSED, const char *msg A_UNUSED, ...) +{ + // Does nothing, that's the whole point of it +} + namespace XML { Document::Document(const std::string &filename, bool useResman): @@ -165,4 +170,15 @@ namespace XML return nullptr; } + // Initialize libxml2 and check for potential ABI mismatches between + // compiled version and the shared library actually used. + void initXML() + { + xmlInitParser(); + LIBXML_TEST_VERSION; + + // Suppress libxml2 error messages + xmlSetGenericErrorFunc(nullptr, xmlNullLogger); + } + } // namespace XML -- cgit v1.2.3-60-g2f50