1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

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.
This commit is contained in:
Paul Eggert
2018-12-26 14:13:43 -08:00
parent 5289f1f56b
commit c0feb731d5
5 changed files with 23 additions and 30 deletions

View File

@ -189,7 +189,7 @@ static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len);
We return 0 if we find a match and REG_NOMATCH if not. */
int
regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string,
regexec (const regex_t *__restrict preg, const char *__restrict string,
size_t nmatch, regmatch_t pmatch[], int eflags)
{
reg_errcode_t err;
@ -232,8 +232,8 @@ __typeof__ (__regexec) __compat_regexec;
int
attribute_compat_text_section
__compat_regexec (const regex_t *_Restrict_ preg,
const char *_Restrict_ string, size_t nmatch,
__compat_regexec (const regex_t *__restrict preg,
const char *__restrict string, size_t nmatch,
regmatch_t pmatch[], int eflags)
{
return regexec (preg, string, nmatch, pmatch,