diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-04-23 11:02:02 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-04-23 11:02:02 +0300 |
commit | d69cb2dbf5d1a4bc524a4da3302f2239fc422165 (patch) | |
tree | a8c81fdef851987e76cd976269528516233f13da | |
parent | e7f0afcf121658de68b3c5083778222c61f04782 (diff) | |
download | egawk-d69cb2dbf5d1a4bc524a4da3302f2239fc422165.tar.gz egawk-d69cb2dbf5d1a4bc524a4da3302f2239fc422165.tar.bz2 egawk-d69cb2dbf5d1a4bc524a4da3302f2239fc422165.zip |
Sync support files from GNULIB.
-rw-r--r-- | support/ChangeLog | 4 | ||||
-rw-r--r-- | support/regcomp.c | 16 | ||||
-rw-r--r-- | support/regex_internal.h | 22 |
3 files changed, 6 insertions, 36 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index 55af128c..3824197e 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,7 @@ +2019-04-23 Arnold D. Robbins <arnold@skeeve.com> + + * regcomp.c, regex_internal.h: Sync from GNULIB. + 2019-04-12 Arnold D. Robbins <arnold@skeeve.com> * ChangeLog.0: Rotated ChangeLog into this file. diff --git a/support/regcomp.c b/support/regcomp.c index 631b70d1..7525355a 100644 --- a/support/regcomp.c +++ b/support/regcomp.c @@ -233,9 +233,7 @@ re_compile_pattern (const char *pattern, size_t length, return NULL; return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]); } -#ifdef _LIBC weak_alias (__re_compile_pattern, re_compile_pattern) -#endif /* Set by 're_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own @@ -260,9 +258,7 @@ re_set_syntax (reg_syntax_t syntax) re_syntax_options = syntax; return ret; } -#ifdef _LIBC weak_alias (__re_set_syntax, re_set_syntax) -#endif int re_compile_fastmap (struct re_pattern_buffer *bufp) @@ -281,9 +277,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) bufp->fastmap_accurate = 1; return 0; } -#ifdef _LIBC weak_alias (__re_compile_fastmap, re_compile_fastmap) -#endif static inline void __attribute__ ((always_inline)) @@ -464,7 +458,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, the return codes and their meanings.) */ int -regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) +regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags) { reg_errcode_t ret; reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED @@ -515,16 +509,14 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) return (int) ret; } -#ifdef _LIBC libc_hidden_def (__regcomp) weak_alias (__regcomp, regcomp) -#endif /* Returns a message corresponding to an error code, ERRCODE, returned from either regcomp or regexec. We don't use PREG here. */ size_t -regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, +regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf, size_t errbuf_size) { const char *msg; @@ -555,9 +547,7 @@ regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, return msg_size; } -#ifdef _LIBC weak_alias (__regerror, regerror) -#endif #ifdef RE_ENABLE_I18N @@ -657,10 +647,8 @@ regfree (regex_t *preg) re_free (preg->translate); preg->translate = NULL; } -#ifdef _LIBC libc_hidden_def (__regfree) weak_alias (__regfree, regfree) -#endif /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ diff --git a/support/regex_internal.h b/support/regex_internal.h index fee1c84f..5462419b 100644 --- a/support/regex_internal.h +++ b/support/regex_internal.h @@ -144,13 +144,8 @@ # define __mbrtowc mbrtowc # define __wcrtomb wcrtomb # define __regfree regfree -# define attribute_hidden #endif /* not _LIBC */ -#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1) -# define __attribute__(arg) -#endif - #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif @@ -868,23 +863,6 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx) } #endif /* RE_ENABLE_I18N */ -#ifndef __GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -# else -# define __GNUC_PREREQ(maj, min) 0 -# endif -#endif - -#if __GNUC_PREREQ (3,4) -# undef __attribute_warn_unused_result__ -# define __attribute_warn_unused_result__ \ - __attribute__ ((__warn_unused_result__)) -#else -# define __attribute_warn_unused_result__ /* empty */ -#endif - #ifndef FALLTHROUGH # if __GNUC__ < 7 # define FALLTHROUGH ((void) 0) |