cogl: Make _Static_assert non-optional

This commit is contained in:
Jonas Ådahl 2018-05-03 20:16:35 +02:00
parent da741ead25
commit 9846a4d812
3 changed files with 2 additions and 14 deletions

View File

@ -12,6 +12,3 @@
/* Define to 1 if you have the `memmem' function. */
#undef HAVE_MEMMEM
/* Whether _Static_assert can be used or not */
#undef HAVE_STATIC_ASSERT

View File

@ -218,16 +218,9 @@ _cogl_util_pixel_format_from_masks (unsigned long r_mask,
* Allows you to assert that an expression evaluates to true at
* compile time and aborts compilation if not. If possible message
* will also be printed if the assertion fails.
*
* Note: Only Gcc >= 4.6 supports the c11 _Static_assert which lets us
* print a nice message if the compile time assertion fails.
*/
#ifdef HAVE_STATIC_ASSERT
#define _COGL_STATIC_ASSERT(EXPRESSION, MESSAGE) \
_Static_assert (EXPRESSION, MESSAGE);
#else
#define _COGL_STATIC_ASSERT(EXPRESSION, MESSAGE)
#endif
#ifdef HAVE_MEMMEM
#define _cogl_util_memmem memmem

View File

@ -173,10 +173,8 @@ dnl ============================================================
AC_MSG_CHECKING([for _Static_assert])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_Static_assert (1, "");],
[(void) 0])],
[AC_DEFINE([HAVE_STATIC_ASSERT], [1],
[Whether _Static_assert can be used or not])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([Missing _Static_assert])])
dnl ================================================================
dnl Libtool stuff.