# HG changeset patch # User Paul Eggert # Date 783211425 0 # Node ID 96a592ccb75187a18ebfa18665b19f9a975e2ec5 # Parent dfe865222721dd92f2810fd59d9fa5f7f313a9ef (re_comp, re_exec): Define this obsolete 4.2bsd interface only if the new feature test macro _REGEX_RE_COMP is defined. This avoids a clash with Cray YMP include files. diff -r dfe865222721 -r 96a592ccb751 src/regex.c --- a/src/regex.c Wed Oct 26 20:07:50 1994 +0000 +++ b/src/regex.c Wed Oct 26 22:43:45 1994 +0000 @@ -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 -r dfe865222721 -r 96a592ccb751 src/regex.h --- a/src/regex.h Wed Oct 26 20:07:50 1994 +0000 +++ b/src/regex.h Wed Oct 26 22:43:45 1994 +0000 @@ -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));