(re_comp, re_exec): Define this obsolete 4.2bsd
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Oct 1994 22:43:45 +0000 (22:43 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Oct 1994 22:43:45 +0000 (22:43 +0000)
interface only if the new feature test macro _REGEX_RE_COMP is defined.
This avoids a clash with Cray YMP include files.

regex.c
regex.h

diff --git a/regex.c b/regex.c
index c7674a1e9c37a60f192df8d3cd899065237dca4e..33c7ea242cd66602800121fd0a0e3fcc33e6a5fb 100644 (file)
--- a/regex.c
+++ b/regex.c
@@ -4934,9 +4934,9 @@ re_compile_pattern (pattern, length, bufp)
 }     
 \f
 /* Entry points compatible with 4.2 BSD regex library.  We don't define
-   them if this is an Emacs or POSIX compilation.  */
+   them unless specifically requested.  */
 
-#if !defined (emacs) && !defined (_POSIX_SOURCE)
+#ifdef _REGEX_RE_COMP
 
 /* BSD has one and only one pattern buffer.  */
 static struct re_pattern_buffer re_comp_buf;
@@ -4987,7 +4987,7 @@ re_exec (s)
   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 */
 \f
 /* POSIX.2 functions.  Don't define these for Emacs.  */
 
diff --git a/regex.h b/regex.h
index 40f684cb8e554c4358634947f83eb9451e991980..55927f627c959118914a93d6a70731266b2579a7 100644 (file)
--- a/regex.h
+++ b/regex.h
@@ -460,9 +460,11 @@ extern void re_set_registers
   _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));