After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 361675 - Allow applications to use libxml2 and GStreamer even if the latter is configured using --disable-registry and --disable-loadsave
Allow applications to use libxml2 and GStreamer even if the latter is config...
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal minor
: 0.10.11
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2006-10-12 11:15 UTC by Peter Kjellerstedt
Modified: 2006-10-17 11:57 UTC
See Also:
GNOME target: ---
GNOME version: ---

Define a GstXmlNodePtr instead of xmlNodePtr (2.25 KB, patch)
2006-10-12 11:16 UTC, Peter Kjellerstedt
committed Details | Review

Description Peter Kjellerstedt 2006-10-12 11:15:13 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?

Other information:
Comment 1 Peter Kjellerstedt 2006-10-12 11:16:23 UTC
Created attachment 74556 [details] [review]
Define a GstXmlNodePtr instead of xmlNodePtr
Comment 2 Tim-Philipp Müller 2006-10-12 12:02:51 UTC
Just an #undef xmlNodePtr at the end doesn't work? (not pretty either, but nothing is really)
Comment 3 Peter Kjellerstedt 2006-10-12 15:08:35 UTC
I guess an #undef would work as well, but I do not like messing with the namespace of something else...
Comment 4 Tim-Philipp Müller 2006-10-17 11:57:43 UTC
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