File 2081-erts-Add-ERTS_RESTRICT.patch of Package erlang
From bf8c53ca0ab214ee794ba06376300e2da9cb51d2 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Wed, 17 Jan 2018 16:43:39 +0100
Subject: [PATCH 1/4] erts: Add ERTS_RESTRICT
---
erts/configure.in | 21 +++++++++++++++++++--
1 file 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])
## tree-copyrename was broken in gcc 4.3 and then removed in gcc 6
@@ -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 */
--
2.16.1