summaryrefslogtreecommitdiffstats
path: root/gl/regex.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/regex.h')
-rw-r--r--gl/regex.h52
1 files changed, 28 insertions, 24 deletions
diff --git a/gl/regex.h b/gl/regex.h
index 6885ebd..a531283 100644
--- a/gl/regex.h
+++ b/gl/regex.h
@@ -6,7 +6,7 @@
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option) 9 the Free Software Foundation; either version 3, or (at your option)
10 any later version. 10 any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
@@ -625,41 +625,45 @@ extern int re_exec (const char *);
625#endif 625#endif
626 626
627/* GCC 2.95 and later have "__restrict"; C99 compilers have 627/* GCC 2.95 and later have "__restrict"; C99 compilers have
628 "restrict", and "configure" may have defined "restrict". */ 628 "restrict", and "configure" may have defined "restrict".
629#ifndef __restrict 629 Other compilers use __restrict, __restrict__, and _Restrict, and
630# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)) 630 'configure' might #define 'restrict' to those words, so pick a
631# if defined restrict || 199901L <= __STDC_VERSION__ 631 different name. */
632# define __restrict restrict 632#ifndef _Restrict_
633# else 633# if 199901L <= __STDC_VERSION__
634# define __restrict 634# define _Restrict_ restrict
635# endif 635# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
636# define _Restrict_ __restrict
637# else
638# define _Restrict_
636# endif 639# endif
637#endif 640#endif
638/* gcc 3.1 and up support the [restrict] syntax. Don't trust 641/* gcc 3.1 and up support the [restrict] syntax. Don't trust
639 sys/cdefs.h's definition of __restrict_arr, though, as it 642 sys/cdefs.h's definition of __restrict_arr, though, as it
640 mishandles gcc -ansi -pedantic. */ 643 mishandles gcc -ansi -pedantic. */
641#undef __restrict_arr 644#ifndef _Restrict_arr_
642#if ((199901L <= __STDC_VERSION__ \ 645# if ((199901L <= __STDC_VERSION__ \
643 || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \ 646 || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \
644 && !__STRICT_ANSI__)) \ 647 && !__STRICT_ANSI__)) \
645 && !defined __GNUG__) 648 && !defined __GNUG__)
646# define __restrict_arr __restrict 649# define _Restrict_arr_ _Restrict_
647#else 650# else
648# define __restrict_arr 651# define _Restrict_arr_
652# endif
649#endif 653#endif
650 654
651/* POSIX compatibility. */ 655/* POSIX compatibility. */
652extern int regcomp (regex_t *__restrict __preg, 656extern int regcomp (regex_t *_Restrict_ __preg,
653 const char *__restrict __pattern, 657 const char *_Restrict_ __pattern,
654 int __cflags); 658 int __cflags);
655 659
656extern int regexec (const regex_t *__restrict __preg, 660extern int regexec (const regex_t *_Restrict_ __preg,
657 const char *__restrict __string, size_t __nmatch, 661 const char *_Restrict_ __string, size_t __nmatch,
658 regmatch_t __pmatch[__restrict_arr], 662 regmatch_t __pmatch[_Restrict_arr_],
659 int __eflags); 663 int __eflags);
660 664
661extern size_t regerror (int __errcode, const regex_t *__restrict __preg, 665extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg,
662 char *__restrict __errbuf, size_t __errbuf_size); 666 char *_Restrict_ __errbuf, size_t __errbuf_size);
663 667
664extern void regfree (regex_t *__preg); 668extern void regfree (regex_t *__preg);
665 669