[mutter] cogl: Make _Static_assert non-optional
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] cogl: Make _Static_assert non-optional
- Date: Tue, 6 Nov 2018 18:04:08 +0000 (UTC)
commit 9846a4d812cc8771faa67c16bd511b7652d64aed
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu May 3 20:16:35 2018 +0200
cogl: Make _Static_assert non-optional
cogl/cogl-mutter-config.h.in | 3 ---
cogl/cogl/cogl-util.h | 7 -------
cogl/configure.ac | 6 ++----
3 files changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/cogl/cogl-mutter-config.h.in b/cogl/cogl-mutter-config.h.in
index bc7f146ce..83e3a9eda 100644
--- a/cogl/cogl-mutter-config.h.in
+++ b/cogl/cogl-mutter-config.h.in
@@ -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
diff --git a/cogl/cogl/cogl-util.h b/cogl/cogl/cogl-util.h
index 376d177bc..a821e55c4 100644
--- a/cogl/cogl/cogl-util.h
+++ b/cogl/cogl/cogl-util.h
@@ -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
diff --git a/cogl/configure.ac b/cogl/configure.ac
index 3be282fc2..7566d7fc9 100644
--- a/cogl/configure.ac
+++ b/cogl/configure.ac
@@ -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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]