[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to grep/lib/posix/regex.h,v
From: |
Tony Abou-Assaleh |
Subject: |
Changes to grep/lib/posix/regex.h,v |
Date: |
Sun, 25 Jan 2009 02:36:38 +0000 |
CVSROOT: /sources/grep
Module name: grep
Changes by: Tony Abou-Assaleh <taa> 09/01/25 02:36:37
Index: lib/posix/regex.h
===================================================================
RCS file: /sources/grep/grep/lib/posix/regex.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- lib/posix/regex.h 28 Jun 2007 19:10:45 -0000 1.4
+++ lib/posix/regex.h 25 Jan 2009 02:36:37 -0000 1.5
@@ -1,6 +1,7 @@
/* Definitions for data structures and routines for the regular
expression library, version 0.12.
- Copyright (C) 1985,1989-1993,1995-1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1985,1989-1993,1995-1998, 2000, 2006, 2007, 2009
+ Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
@@ -520,29 +521,41 @@
#endif
/* GCC 2.95 and later have "__restrict"; C99 compilers have
- "restrict", and "configure" may have defined "restrict". */
-#ifndef __restrict
-# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
-# if defined restrict || 199901L <= __STDC_VERSION__
-# define __restrict restrict
+ "restrict", and "configure" may have defined "restrict".
+ Other compilers use __restrict, __restrict__, and _Restrict, and
+ 'configure' might #define 'restrict' to those words, so pick a
+ different name. */
+#ifndef _Restrict_
+# if 199901L <= __STDC_VERSION__
+# define _Restrict_ restrict
+# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
+# define _Restrict_ __restrict
# else
-# define __restrict
+# define _Restrict_
# endif
+#endif
+/* gcc 3.1 and up support the [restrict] syntax. Don't trust
+ sys/cdefs.h's definition of __restrict_arr, though, as it
+ mishandles gcc -ansi -pedantic. */
+#ifndef _Restrict_arr_
+# if ((199901L <= __STDC_VERSION__ \
+ || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \
+ && !__STRICT_ANSI__)) \
+ && !defined __GNUG__)
+# define _Restrict_arr_ _Restrict_
+# else
+# define _Restrict_arr_
# endif
#endif
-/* For now unconditionally define __restrict_arr to expand to nothing.
- Ideally we would have a test for the compiler which allows defining
- it to restrict. */
-#define __restrict_arr
/* POSIX compatibility. */
-extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
- const char *__restrict __pattern,
+extern int regcomp _RE_ARGS ((regex_t *_Restrict_ __preg,
+ const char *_Restrict_ __pattern,
int __cflags));
-extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,
- const char *__restrict __string, size_t __nmatch,
- regmatch_t __pmatch[__restrict_arr],
+extern int regexec _RE_ARGS ((const regex_t *_Restrict_ __preg,
+ const char *_Restrict_ __string, size_t __nmatch,
+ regmatch_t __pmatch[_Restrict_arr_],
int __eflags));
extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Changes to grep/lib/posix/regex.h,v,
Tony Abou-Assaleh <=