summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--m4/gst-dowhile.m424
2 files changed, 33 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f22c4cf..5a87e22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2008-03-21 Sebastian Dröge <slomo@circular-chaos.org>
+ * m4/gst-dowhile.m4:
+ Add macro that checks if the compiler supports do {} while (0)
+ macros and define HAVE_DOWHILE_MACROS if it does. This is
+ needed by glib/gmacros.h to use something else than
+ if (1) else for G_STMT_START/END when compling C++, which
+ causes compiler warnings because of ambigious else with g++ 4.3.
+
+2008-03-21 Sebastian Dröge <slomo@circular-chaos.org>
+
* m4/gst-plugin-docs.m4:
* mangle-tmpl.py:
Don't depend on PyXML and use only XML modules that are shipped
diff --git a/m4/gst-dowhile.m4 b/m4/gst-dowhile.m4
new file mode 100644
index 0000000..a5605d7
--- /dev/null
+++ b/m4/gst-dowhile.m4
@@ -0,0 +1,24 @@
+dnl
+dnl Check for working do while(0) macros. This is used by G_STMT_START
+dnl and G_STMT_END in glib/gmacros.h. Without having this defined we
+dnl get "ambigious if-else" compiler warnings when compling C++ code.
+dnl
+dnl Copied from GLib's configure.in
+dnl
+AC_DEFUN([AG_GST_CHECK_DOWHILE_MACROS],[
+
+dnl *** check for working do while(0) macros ***
+AC_CACHE_CHECK([for working do while(0) macros], g_support_dowhile_macros, [
+ AC_TRY_COMPILE([],[
+ #define STMT_START do
+ #define STMT_END while(0)
+ #define STMT_TEST STMT_START { i = 0; } STMT_END
+ int main(void) { int i = 1; STMT_TEST; return i; }],
+ [g_support_dowhile_macros=yes],
+ [g_support_dowhile_macros=no],
+ [g_support_dowhile_macros=yes])
+])
+if test x$g_support_dowhile_macros = xyes; then
+ AC_DEFINE(HAVE_DOWHILE_MACROS, 1, [define for working do while(0) macros])
+fi
+])