From 8f08915164484b43782f2be93016dbb3ade3ff05 Mon Sep 17 00:00:00 2001 From: schnetter Date: Sun, 2 Apr 2006 16:59:49 +0000 Subject: Add another test when checking for the "restrict" qualifiers. Some buggy compilers (e.g. old versions of gcc) do not support "restrict" on arrays which are function arguments. On these compilers, we now disable "restrict". git-svn-id: http://svn.cactuscode.org/flesh/trunk@4280 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/make/aclocal.m4 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/make') diff --git a/lib/make/aclocal.m4 b/lib/make/aclocal.m4 index 4a7bf769..39035a1c 100644 --- a/lib/make/aclocal.m4 +++ b/lib/make/aclocal.m4 @@ -283,7 +283,10 @@ AC_DEFUN(CCTK_CHECK_C_RESTRICT, [AC_CACHE_CHECK([for C restrict], cctk_cv_c_restrict, [cctk_cv_c_restrict=no for ac_kw in restrict __restrict__ __restrict; do - AC_TRY_COMPILE(, [double * $ac_kw foo;], [cctk_cv_c_restrict=$ac_kw; break]) + AC_TRY_COMPILE(, [ +double * $ac_kw foo; +void bar (void * $ac_kw arr[]); +], [cctk_cv_c_restrict=$ac_kw; break]) done ]) case "$cctk_cv_c_restrict" in @@ -299,7 +302,10 @@ AC_DEFUN(CCTK_CHECK_CXX_RESTRICT, AC_LANG_SAVE AC_LANG_CPLUSPLUS for ac_kw in restrict __restrict__ __restrict; do - AC_TRY_COMPILE(, [double * $ac_kw foo;], [cctk_cv_cxx_restrict=$ac_kw; break]) + AC_TRY_COMPILE(, [ +double * $ac_kw foo; +void bar (void * $ac_kw arr[]); +], [cctk_cv_cxx_restrict=$ac_kw; break]) done AC_LANG_RESTORE ]) -- cgit v1.2.3