GNOME Bugzilla – Bug 361675
Allow applications to use libxml2 and GStreamer even if the latter is configured using --disable-registry and --disable-loadsave
Last modified: 2006-10-17 11:57:43 UTC
Please describe the problem: If I try to compile an application which uses both libxml2 and GStreamer, it will fail if I have configured GStreamer to neither use the registry nor loadsave. This is because gstobject.h defines xmlNode to gpointer if GST_DISABLE_LOADSAVE_REGISTRY is defined. However, this definition will clash with the real declaration in libxml2 when the application includes it. Steps to reproduce: 1. Configure and build GStreamer with -disable-registry and --disable-loadsave 2. Build an application that uses both libxml2 and GStreamer Actual results: I get a compiler warning, and with -Werror that is fatal... Expected results: The compilation should succeed. Does this happen every time? Yes Other information:
Created attachment 74556 [details] [review] Define a GstXmlNodePtr instead of xmlNodePtr
Just an #undef xmlNodePtr at the end doesn't work? (not pretty either, but nothing is really)
I guess an #undef would work as well, but I do not like messing with the namespace of something else...
Agreed. Committed with some space/tab clean-ups, thanks for the patch: 2006-10-17 Tim-Philipp Müller <tim at centricular dot net> Patch by: Peter Kjellerstedt <pkj at axis com> * gst/gstobject.h: Don't define xmlNodePtr to gpointer if the core was built with --disable-loadsave and --disable-registry, this will break applications that want to use libxml2 but are buildling against a core that doesn't use libxml2. Use an intermediary type GstXmlNodePtr instead so we don't have to mess with the libxml2 namespace (#361675).