aboutsummaryrefslogtreecommitdiffstats
path: root/src/regex.h
diff options
context:
space:
mode:
authorTom Tromey2013-07-12 18:44:13 -0600
committerTom Tromey2013-07-12 18:44:13 -0600
commitb34a529f177a6ea32da5cb1254f91bf9d71838db (patch)
tree477131abc15d3107b30b635223d87a22550b480b /src/regex.h
parente6f63071a3f7721f55220514b6d9a8ee8c1232d8 (diff)
parent5e301d7651c0691bb2bc7f3fbe711fdbe26ac471 (diff)
downloademacs-b34a529f177a6ea32da5cb1254f91bf9d71838db.tar.gz
emacs-b34a529f177a6ea32da5cb1254f91bf9d71838db.zip
Merge from trunk
Diffstat (limited to 'src/regex.h')
-rw-r--r--src/regex.h46
1 files changed, 28 insertions, 18 deletions
diff --git a/src/regex.h b/src/regex.h
index 175eed10177..31be0504c9e 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -528,31 +528,41 @@ extern int re_exec (const char *);
528#endif 528#endif
529 529
530/* GCC 2.95 and later have "__restrict"; C99 compilers have 530/* GCC 2.95 and later have "__restrict"; C99 compilers have
531 "restrict", and "configure" may have defined "restrict". */ 531 "restrict", and "configure" may have defined "restrict".
532#ifndef __restrict 532 Other compilers use __restrict, __restrict__, and _Restrict, and
533# if ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) 533 'configure' might #define 'restrict' to those words, so pick a
534# if defined restrict || 199901L <= __STDC_VERSION__ 534 different name. */
535# define __restrict restrict 535#ifndef _Restrict_
536# else 536# if 199901L <= __STDC_VERSION__
537# define __restrict 537# define _Restrict_ restrict
538# endif 538# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
539# define _Restrict_ __restrict
540# else
541# define _Restrict_
539# endif 542# endif
540#endif 543#endif
541/* For now conditionally define __restrict_arr to expand to nothing. 544/* gcc 3.1 and up support the [restrict] syntax. Don't trust
542 Ideally we would have a test for the compiler which allows defining 545 sys/cdefs.h's definition of __restrict_arr, though, as it
543 it to restrict. */ 546 mishandles gcc -ansi -pedantic. */
544#ifndef __restrict_arr 547#ifndef _Restrict_arr_
545# define __restrict_arr 548# if ((199901L <= __STDC_VERSION__ \
549 || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \
550 && !defined __STRICT_ANSI__)) \
551 && !defined __GNUG__)
552# define _Restrict_arr_ _Restrict_
553# else
554# define _Restrict_arr_
555# endif
546#endif 556#endif
547 557
548/* POSIX compatibility. */ 558/* POSIX compatibility. */
549extern reg_errcode_t regcomp (regex_t *__restrict __preg, 559extern reg_errcode_t regcomp (regex_t *_Restrict_ __preg,
550 const char *__restrict __pattern, 560 const char *_Restrict_ __pattern,
551 int __cflags); 561 int __cflags);
552 562
553extern reg_errcode_t regexec (const regex_t *__restrict __preg, 563extern reg_errcode_t regexec (const regex_t *_Restrict_ __preg,
554 const char *__restrict __string, size_t __nmatch, 564 const char *_Restrict_ __string, size_t __nmatch,
555 regmatch_t __pmatch[__restrict_arr], 565 regmatch_t __pmatch[_Restrict_arr_],
556 int __eflags); 566 int __eflags);
557 567
558extern size_t regerror (int __errcode, const regex_t * __preg, 568extern size_t regerror (int __errcode, const regex_t * __preg,