diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2024-12-13 07:13:00 +0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2024-12-14 19:29:12 +0800 |
commit | c8c35f8c0ffb81ac5e9117cceaf6cc8bc518e564 (patch) | |
tree | 36feef1b3caa82c149c07330fd506e0e4de34d20 | |
parent | 5e17b4c983748e7938aef90c90d417e1ca739e20 (diff) | |
download | glibc-c8c35f8c0ffb81ac5e9117cceaf6cc8bc518e564.zip glibc-c8c35f8c0ffb81ac5e9117cceaf6cc8bc518e564.tar.gz glibc-c8c35f8c0ffb81ac5e9117cceaf6cc8bc518e564.tar.bz2 |
regex.h: Avoid #elif __STDC_VERSION__
GCC 4.9 doesn't define __STDC_VERSION__ and issues an error:
In file included from ../include/regex.h:2:0,
from ../posix/re_comp.h:23,
from ../include/re_comp.h:1,
from /tmp/cih_test_7IKTRI.c:10:
../posix/regex.h:650:19: error: "__STDC_VERSION__" is not defined [-Werror=undef]
# elif 199901L <= __STDC_VERSION__ || defined restrict
^
Use "#else" instead.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
-rw-r--r-- | posix/regex.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/posix/regex.h b/posix/regex.h index ccf40ce..004dc62 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -647,10 +647,12 @@ extern int re_exec (const char *); || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ || __clang_major__ >= 3 # define _Restrict_ __restrict -# elif 199901L <= __STDC_VERSION__ || defined restrict -# define _Restrict_ restrict # else -# define _Restrict_ +# if 199901L <= __STDC_VERSION__ || defined restrict +# define _Restrict_ restrict +# else +# define _Restrict_ +# endif # endif #endif /* For the ISO C99 syntax @@ -661,13 +663,15 @@ extern int re_exec (const char *); #ifndef _Restrict_arr_ # ifdef __restrict_arr # define _Restrict_arr_ __restrict_arr -# elif ((199901L <= __STDC_VERSION__ \ +# else +# if ((199901L <= __STDC_VERSION__ \ || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \ || __clang_major__ >= 3) \ && !defined __cplusplus) -# define _Restrict_arr_ _Restrict_ -# else -# define _Restrict_arr_ +# define _Restrict_arr_ _Restrict_ +# else +# define _Restrict_arr_ +# endif # endif #endif |