X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fregex.h;h=91a3560678f918357763bf14bfc55cee6c282403;hb=4028e63dd21b964fdcd76448c973cbad683982e4;hp=5edeff3551fdec114aac10ed2afb87ef33a06eca;hpb=34d6df51137e66e6bdaf350c4041374d273f1e04;p=gnulib.git diff --git a/lib/regex.h b/lib/regex.h index 5edeff355..91a356067 100644 --- a/lib/regex.h +++ b/lib/regex.h @@ -513,13 +513,31 @@ extern int re_exec _RE_ARGS ((const char *)); # endif #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 +# else +# define __restrict +# endif +# 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 *__preg, const char *__pattern, +extern int regcomp _RE_ARGS ((regex_t *__restrict __preg, + const char *__restrict __pattern, int __cflags)); -extern int regexec _RE_ARGS ((const regex_t *__preg, - const char *__string, size_t __nmatch, - regmatch_t __pmatch[], int __eflags)); +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, char *__errbuf, size_t __errbuf_size));