diff options
author | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-05-20 14:44:43 +0000 |
---|---|---|
committer | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-05-20 14:44:43 +0000 |
commit | 72ced1dca342ab7d6ecab897e6f041f42f39a21b (patch) | |
tree | b5391d2507e1945c5a8dc4dfe47065ba5e29ae46 /lib/make/aclocal.m4 | |
parent | 6d26c28d3b9562087a41514499cb585df3dd52f0 (diff) |
Auto-configure static_assert
Check whether static_assert is supported by C++. Define a work-around
if it is not supported.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@5014 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/aclocal.m4')
-rw-r--r-- | lib/make/aclocal.m4 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/make/aclocal.m4 b/lib/make/aclocal.m4 index 2d459ce2..2851bf0f 100644 --- a/lib/make/aclocal.m4 +++ b/lib/make/aclocal.m4 @@ -1111,6 +1111,21 @@ fi +AC_DEFUN(CCTK_CXX_STATIC_ASSERT, +[AC_CACHE_CHECK([for CXX static_assert], cctk_cv_have_cxx_static_assert, +[cctk_cv_have_cxx_static_assert=no +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_LINK(, static_assert(1, "good");, cctk_cv_have_cxx_static_assert=yes, cctk_cv_have_cxx_static_assert=no) +AC_LANG_RESTORE +]) +if test "$cctk_cv_have_cxx_static_assert" = "yes" ; then + AC_DEFINE(HAVE_CCTK_CXX_STATIC_ASSERT) +fi +]) + + + dnl Check for a function that may be provided by cmath or math.h AC_DEFUN(CCTK_CHECK_CXX_STDMATHFUNC, [cctk_func=`echo $1 | sed 'y%./+-%__p_%'` |