From c0feb731d5bd063f351487c28eadaf37b33d07a5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 26 Dec 2018 14:13:43 -0800 Subject: regex: simplify Gnulib port This simplifies the code, by removing stuff intended for porting to Gnulib but no longer needed there. * posix/regcomp.c [!_LIBC]: No need to put #ifdef _LIBC around uses of libc_hidden_def, weak_alias. * posix/regcomp.c, posix/regexec.c: Use __restrict rather than _Restrict_ except for public-facing headers. * posix/regex_internal.h (attribute_hidden) [!_LIBC]: Remove; already defined elsewhere. * posix/regex.c, posix/regex_internal.h: Use __GNUC_PREREQ instead of rolling our own. * posix/regex_internal.h (__GNUC_PREREQ): Remove duplicate defn. --- posix/regex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'posix/regex.c') diff --git a/posix/regex.c b/posix/regex.c index a80e740c68..9d2071d3c5 100644 --- a/posix/regex.c +++ b/posix/regex.c @@ -20,10 +20,10 @@ #ifndef _LIBC # include -# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# if __GNUC_PREREQ (4, 6) # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" # endif -# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# if __GNUC_PREREQ (4, 3) # pragma GCC diagnostic ignored "-Wold-style-definition" # pragma GCC diagnostic ignored "-Wtype-limits" # endif -- cgit 1.4.1