summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-09-06 15:27:04 +0200
committerLucas De Marchi <lucas.demarchi@intel.com>2013-09-06 11:06:19 -0300
commitdc8ed09f8f21d17ef9481001683d7edfdb308983 (patch)
tree1a8bf2807d8a3aea3d0a9daf39b105a1d2603cee /configure.ac
parent7e0385c47ae7c313a59de3ea431af7b5d18807d7 (diff)
downloadkmod-dc8ed09f8f21d17ef9481001683d7edfdb308983.tar.gz
kmod-dc8ed09f8f21d17ef9481001683d7edfdb308983.tar.bz2
kmod-dc8ed09f8f21d17ef9481001683d7edfdb308983.zip
Add configure check for _Static_assert()
Commit 8efede20ef ("Use _Static_assert") introduced the usage of _Static_assert(). However, _Static_assert() is a fairly new thing, since it was introduced only in gcc 4.6. In order to support older compilers, this patch adds a configure.in test that checks whether _Static_assert() is usable or not, and adjust the behavior of the assert_cc() macro accordingly.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 40e54cf..a192c81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,12 @@ AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
# Check kernel headers
AC_CHECK_HEADERS_ONCE([linux/module.h])
+AC_MSG_CHECKING([whether _Static_assert() is supported])
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[_Static_assert(1, "Test");]])],
+ [AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define if _Static_assert() is available])
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])])
#####################################################################
# --with-