[glibmm] Fix the build with --enable-warnings=fatal.



commit a1565a33021e78d384babcf9a5c84a1351ab1c62
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Feb 21 11:05:22 2013 +0100

    Fix the build  with --enable-warnings=fatal.
    
        * glib/src/threads.hg: The GThread definition is now deprecated,
        meaning it should only be used via a pointer.
        However, we depend on it, so this temporarily undefs the
        deprecation, so we can still use those checks elsewhere in the build.
        It looks like we will have to do a third version of Glib::Threads,
        after already replacing Glib::Thread.
        This fixes make distcheck.

 ChangeLog           |   12 ++++++++++++
 glib/src/threads.hg |   28 ++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7c13c23..db4242c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-02-21  Murray Cumming  <murrayc murrayc com>
+
+       Fix the build  with --enable-warnings=fatal.
+
+       * glib/src/threads.hg: The GThread definition is now deprecated,
+       meaning it should only be used via a pointer.
+       However, we depend on it, so this temporarily undefs the
+       deprecation, so we can still use those checks elsewhere in the build.
+       It looks like we will have to do a third version of Glib::Threads,
+       after already replacing Glib::Thread.
+       This fixes make distcheck.
+
 2013-02-21  Kjell Ahlstedt  <kjell ahlstedt bredband net>
 
        Signal*::connect(): Make them less thread-unsafe.
diff --git a/glib/src/threads.hg b/glib/src/threads.hg
index 6c7ea03..9e536cc 100644
--- a/glib/src/threads.hg
+++ b/glib/src/threads.hg
@@ -18,8 +18,36 @@
 _DEFS(glibmm,glib)
 _CONFIGINCLUDE(glibmmconfig.h)
 
+
+// We use the (now deprecated) GThread definition in the API,
+// and we cannot stop that without breaking ABI.
+// (see the comment below),
+// so we must temporarily undef G_DISABLE_DEPRECATED when
+// including glib.h.
+
+// Temporarily undef G_DISABLE_DEPRECATED, redefining it later if appropriate.
+#if defined(G_DISABLE_DEPRECATED) && !defined(GLIBMM_G_DISABLE_DEPRECATED_UNDEFED)
+
+//Stop the deprecation ifdef guards around the API declarations:
+#undef G_DISABLE_DEPRECATED
+
+//Stop the compiler warnings about using the deprecated API;
+#define GLIB_DISABLE_DEPRECATION_WARNINGS 1
+
+#define GLIBMM_G_DISABLE_DEPRECATED_UNDEFED 1
+
+#endif
+
 #include <glib.h>
 
+// Redefine G_DISABLE_DEPRECATED if it was defined before we temporarily undefed it:
+#if defined(GLIBMM_G_DISABLE_DEPRECATED_UNDEFED)
+#define G_DISABLE_DEPRECATED 1
+#undef GLIB_DISABLE_DEPRECATION_WARNINGS
+#undef GLIBMM_G_DISABLE_DEPRECATED_UNDEFED
+#endif
+
+
 #include <glibmm/error.h>
 #include <sigc++/sigc++.h>
 


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