summaryrefslogtreecommitdiff
path: root/base/stdpre.h
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2018-03-26 20:55:39 +0100
committerChris Liddell <chris.liddell@artifex.com>2018-03-27 09:59:14 +0100
commitb24a4bd9bab156443c4667d4266e3deb43f933f7 (patch)
treec962edf6855fb3649719f0e346bbcf99c32e904a /base/stdpre.h
parent12d2e6e44c4ed919bd38f2a13314f4942decd610 (diff)
downloadghostpdl-b24a4bd9bab156443c4667d4266e3deb43f933f7.tar.gz
Bug 699141(redux): use "restrict" on compatible compilers
The definition of gs_restrict was missing for C99 compilers. Even with compilers that claim C99 compatibility, we honor the configure check for restrict.
Diffstat (limited to 'base/stdpre.h')
-rw-r--r--base/stdpre.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/base/stdpre.h b/base/stdpre.h
index 7fd7ecbd1..73cf18028 100644
--- a/base/stdpre.h
+++ b/base/stdpre.h
@@ -95,18 +95,25 @@
/* restrict is standard in C99, but not in all C++ compilers. */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ == 199901L /* C99 */
+# if defined(HAVE_RESTRICT) && HAVE_RESTRICT==1
+# define gs_restrict restrict
+# else /* defined(HAVE_RESTRICT) && HAVE_RESTRICT==1 */
+# define gs_restrict
+# endif /* defined(HAVE_RESTRICT) && HAVE_RESTRICT==1 */
#elif defined(_MSC_VER) && _MSC_VER >= 1500 /* MSVC 9 or newer */
-#define gs_restrict __restrict
+# define gs_restrict __restrict
#elif __GNUC__ >= 3 /* GCC 3 or newer */
-#if defined(HAVE_RESTRICT) && HAVE_RESTRICT==1
-#define gs_restrict __restrict
-#else /* defined(HAVE_RESTRICT) && HAVE_RESTRICT==1 */
-#define gs_restrict
-#endif /* defined(HAVE_RESTRICT) && HAVE_RESTRICT==1 */
+# if defined(HAVE_RESTRICT) && HAVE_RESTRICT==1
+# define gs_restrict __restrict
+# else /* defined(HAVE_RESTRICT) && HAVE_RESTRICT==1 */
+# define gs_restrict
+# endif /* defined(HAVE_RESTRICT) && HAVE_RESTRICT==1 */
#else /* Unknown or ancient */
-#define gs_restrict
+# define gs_restrict
#endif
+
+
/* Disable 'inline' if the compiler can't handle it. */
#ifdef __DECC
# undef inline