[vlc-commits] Robustify static_assert() check

Rémi Denis-Courmont git at videolan.org
Wed Nov 7 17:58:27 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Nov  7 18:58:13 2012 +0200| [049eadc4473c36d5d63226b171e23099ce88e30d] | committer: Rémi Denis-Courmont

Robustify static_assert() check

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=049eadc4473c36d5d63226b171e23099ce88e30d
---

 configure.ac |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index c1ad99f..876ab1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -515,11 +515,8 @@ AC_LINK_IFELSE([
 
 dnl C11 static_assert()
 AC_MSG_CHECKING([for static_assert in assert.h])
-AC_PREPROC_IFELSE([AC_LANG_SOURCE([
-#include <assert.h>
-#ifndef static_assert
-# error BOOM!
-#endif
+AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <assert.h>], [
+static_assert(1, "The impossible happened.");
 ])], [
   AC_MSG_RESULT([yes])
   AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define to 1 if <assert.h> defines static_assert.])



More information about the vlc-commits mailing list