[glib] Hack to include glib/gdatasetprivate.h directly



commit 01a46e5c652ec8030226a9cf54025e175f56caac
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Sat Sep 4 17:22:39 2010 +0100

    Hack to include glib/gdatasetprivate.h directly
    
    The gdatasetprivate.h header includes gatomic.h directly. It all works
    well in GLib, but inside GObject it will trigger the single inclusion
    guard.
    
    Since this is a private header, and it's kind of a special case, one way
    to fix it is to declare GLIB_COMPILATION around it and fool the single
    inclusion guard in gatomic.h into thinking we're compiling GLib and not
    GObject.

 gobject/gobject.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index f9280c2..1943405 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -26,7 +26,12 @@
 #include <string.h>
 #include <signal.h>
 
+/* fool the single inclusion guard in gatomic.h, which is directly
+ * included by gdatasetprivate.h
+ */
+#define GLIB_COMPILATION
 #include "glib/gdatasetprivate.h"
+#undef GLIB_COMPILATION
 
 #include "gobject.h"
 #include "gvaluecollector.h"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]