From 087aa6ced43d84abb487d1c386b62232c6d4d4fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 20 Jan 2010 01:09:55 +0000 Subject: [PATCH] gst_private.h: make sure gst_private.h is included before glib.h For the reason outlined at the beginning of gst_private.h (inline functions in glib may need the g_log_domain variable). Also include gst_private.h before using any G_OS_* defines, esp. in plugin loader. --- gst/gst_private.h | 4 ++++ gst/gstplugin.c | 4 +++- gst/gstpluginloader.c | 3 ++- gst/parse/grammar.y | 3 ++- gst/parse/parse.l | 4 ++-- libs/gst/base/gstbasesink.c | 3 ++- libs/gst/helpers/gst-plugin-scanner.c | 6 +++--- plugins/elements/gsttypefindelement.c | 3 ++- 8 files changed, 20 insertions(+), 10 deletions(-) diff --git a/gst/gst_private.h b/gst/gst_private.h index 423e937..aa252bf 100644 --- a/gst/gst_private.h +++ b/gst/gst_private.h @@ -33,6 +33,10 @@ * functions */ extern const char g_log_domain_gstreamer[]; +#ifdef __G_LIB_H__ +#warning "gst_private.h must be included before glib.h" +#endif + #include #include diff --git a/gst/gstplugin.c b/gst/gstplugin.c index 609a789..a498cd2 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -49,6 +49,9 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif + +#include "gst_private.h" + #include #include #ifdef HAVE_DIRENT_H @@ -60,7 +63,6 @@ #include #include -#include "gst_private.h" #include "glib-compat-private.h" #include diff --git a/gst/gstpluginloader.c b/gst/gstpluginloader.c index dd0046b..b4b3d60 100644 --- a/gst/gstpluginloader.c +++ b/gst/gstpluginloader.c @@ -24,6 +24,8 @@ # include "config.h" #endif +#include + #ifndef G_OS_WIN32 #include #include @@ -33,7 +35,6 @@ #endif #include -#include #include #include diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y index 00d0e9d..81a5e2a 100644 --- a/gst/parse/grammar.y +++ b/gst/parse/grammar.y @@ -1,11 +1,12 @@ %{ +#include "../gst_private.h" + #include #include #include #include #include -#include "../gst_private.h" #include "../gst-i18n-lib.h" #include "../gstconfig.h" diff --git a/gst/parse/parse.l b/gst/parse/parse.l index 9e60adc..b9162c2 100644 --- a/gst/parse/parse.l +++ b/gst/parse/parse.l @@ -1,11 +1,11 @@ %{ +#include "../gst_private.h" + #include #include #include -#include "../gst_private.h" - #include "types.h" #include "../gstinfo.h" #include "../gsturi.h" diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 14b4021..76f7a33 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -146,9 +146,10 @@ # include "config.h" #endif +#include + #include "gstbasesink.h" #include -#include #include GST_DEBUG_CATEGORY_STATIC (gst_base_sink_debug); diff --git a/libs/gst/helpers/gst-plugin-scanner.c b/libs/gst/helpers/gst-plugin-scanner.c index 0310a74..baa3019 100644 --- a/libs/gst/helpers/gst-plugin-scanner.c +++ b/libs/gst/helpers/gst-plugin-scanner.c @@ -26,10 +26,10 @@ # include "config.h" #endif -#include - -#include #include +#include + +#include int main (int argc, char *argv[]) diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 0a32c6b..ba0bd08 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -60,8 +60,9 @@ # include "config.h" #endif -#include "gsttypefindelement.h" #include "gst/gst_private.h" + +#include "gsttypefindelement.h" #include "gst/gst-i18n-lib.h" #include "gst/base/gsttypefindhelper.h" -- 2.7.4