This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch to define __restrict_arr


This patch defines __restrict_arr appropriately for glibc, now I've
added support for the syntax to GCC.

2001-05-25  Joseph S. Myers  <jsm28@cam.ac.uk>

	* misc/sys/cdefs.h (__restrict_arr): Define appropriately for GCC
	3.1 and non-GCC C99 compilers.

--- misc/sys/cdefs.h.orig	Sat Dec 30 17:46:38 2000
+++ misc/sys/cdefs.h	Fri May 25 11:33:51 2001
@@ -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 */

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]