aboutsummaryrefslogtreecommitdiff
path: root/misc/sys
diff options
context:
space:
mode:
Diffstat (limited to 'misc/sys')
-rw-r--r--misc/sys/cdefs.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 0c1d2de..ec3b48d 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -195,8 +195,20 @@
/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
array_name[restrict]
- But gcc so far does not support this syntax. We define a separate macro
- for this which can be enabled if the underlying compiler supports it. */
-#define __restrict_arr
+ GCC 3.1 supports this. */
+#if __GNUC_PREREQ (3,1)
+# define __restrict_arr __restrict
+#else
+# ifdef __GNUC__
+# define __restrict_arr /* Not supported in old GCC. */
+# else
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __restrict_arr restrict
+# else
+/* Some other non-C99 compiler. */
+# define __restrict_arr /* Not supported. */
+# endif
+# endif
+#endif
#endif /* sys/cdefs.h */