# HG changeset patch # User Jim Meyering # Date 783493825 0 # Node ID ef0e0232e54ec8675b92dcb30384906f67e3d0df # Parent 516dbf4873737e4c7d86b23de2b49375b2fb5bee GNU text utilities diff --git a/lib/regex.c b/lib/regex.c --- a/lib/regex.c +++ b/lib/regex.c @@ -4934,9 +4934,9 @@ } /* Entry points compatible with 4.2 BSD regex library. We don't define - them if this is an Emacs or POSIX compilation. */ - -#if !defined (emacs) && !defined (_POSIX_SOURCE) + them unless specifically requested. */ + +#ifdef _REGEX_RE_COMP /* BSD has one and only one pattern buffer. */ static struct re_pattern_buffer re_comp_buf; @@ -4987,7 +4987,7 @@ return 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); } -#endif /* not emacs and not _POSIX_SOURCE */ +#endif /* _REGEX_RE_COMP */ /* POSIX.2 functions. Don't define these for Emacs. */ diff --git a/lib/regex.h b/lib/regex.h --- a/lib/regex.h +++ b/lib/regex.h @@ -460,9 +460,11 @@ _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends)); +#ifdef _REGEX_RE_COMP /* 4.2 bsd compatibility. */ extern char *re_comp _RE_ARGS ((const char *)); extern int re_exec _RE_ARGS ((const char *)); +#endif /* POSIX compatibility. */ extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));