Commit 9a358e5c authored by Sebastian Dröge's avatar Sebastian Dröge

m4/gst-dowhile.m4: Add macro that checks if the compiler supports do {} while...

m4/gst-dowhile.m4: Add macro that checks if the compiler supports do {} while (0) macros and define HAVE_DOWHILE_MACR...

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.
parent be0cdb8d
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:
......
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
])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment