summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-03-21 12:38:02 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-03-21 12:38:02 +0000
commit9a358e5cc3977fd6121f12dd25a358081fd77041 (patch)
tree78ca059ed1b2db1981bc7ecdcc55e7dd022a28eb
parentbe0cdb8d7e47ced4f4bec982e499024189983703 (diff)
m4/gst-dowhile.m4: Add macro that checks if the compiler supports do {} while (0) macros and define HAVE_DOWHILE_MACR...RELEASE-0_10_9RELEASE-0_10_8RELEASE-0_10_7RELEASE-0_10_6RELEASE-0_10_5RELEASE-0_10_4RELEASE-0_10_14RELEASE-0_10_13RELEASE-0_10_12RELEASE-0_10_11RELEASE-0_10_10
Original commit message from CVS: * 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.
-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
+])