aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-01-17 16:43:39 +0100
committerSverker Eriksson <[email protected]>2018-01-19 17:42:56 +0100
commitbf8c53ca0ab214ee794ba06376300e2da9cb51d2 (patch)
treed017b81458be2a69bb36bfb4a9b38134a3d17958
parentb02208125f27b20e6ce186afcdc6b79e24ac732a (diff)
downloadotp-bf8c53ca0ab214ee794ba06376300e2da9cb51d2.tar.gz
otp-bf8c53ca0ab214ee794ba06376300e2da9cb51d2.tar.bz2
otp-bf8c53ca0ab214ee794ba06376300e2da9cb51d2.zip
erts: Add ERTS_RESTRICT
-rw-r--r--erts/configure.in21
1 files changed, 19 insertions, 2 deletions
diff --git a/erts/configure.in b/erts/configure.in
index f15bb56435..9646c0d47d 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -1760,6 +1760,25 @@ if test $ac_cv_sizeof_void_p = 8; then
fi
AC_SUBST(BITS64)
+AC_MSG_CHECKING([for C compiler 'restrict' support])
+restrict_keyword=""
+for x in restrict __restrict; do
+ AC_TRY_COMPILE([int * $x foo(int * $x arg);
+ int * $x foo(int * $x arg)
+ { int * $x var=arg; return var;}
+ ],[],
+ [restrict_keyword=$x],[])
+ if test "x$restrict_keyword" != "x"; then
+ break
+ fi
+done
+AC_DEFINE_UNQUOTED(ERTS_RESTRICT,[$restrict_keyword],[Type qualifier restrict])
+if test "x$restrict_keyword" != "x"; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
if test "x$ac_compiler_gnu" = "xyes"; then
AC_MSG_CHECKING([if we should add -fno-tree-copyrename to CFLAGS for computed gotos to work properly])
AC_TRY_COMPILE([],[
@@ -1779,8 +1798,6 @@ else
AC_MSG_RESULT(no)
fi
-
-
AC_MSG_CHECKING([for broken gcc-4.3.0 compiler])
AC_TRY_RUN([
/* pr36339.c */