aboutsummaryrefslogtreecommitdiff
path: root/posix/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/regex.c')
-rw-r--r--posix/regex.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/posix/regex.c b/posix/regex.c
index a79597c542..f8544aebf0 100644
--- a/posix/regex.c
+++ b/posix/regex.c
@@ -66,8 +66,19 @@ char *malloc ();
char *realloc ();
#endif
-/* We used to test for `BSTRING' here, but only GCC and Emacs define
- `BSTRING', as far as I know, and neither of them use this code. */
+/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
+ If nothing else has been done, use the method below. */
+#ifdef INHIBIT_STRING_HEADER
+#if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY))
+#if !defined (bzero) && !defined (bcopy)
+#undef INHIBIT_STRING_HEADER
+#endif
+#endif
+#endif
+
+/* This is the normal way of making sure we have a bcopy and a bzero.
+ This is used in most programs--a few other programs avoid this
+ by defining INHIBIT_STRING_HEADER. */
#ifndef INHIBIT_STRING_HEADER
#if HAVE_STRING_H || STDC_HEADERS || defined (_LIBC)
#include <string.h>
@@ -187,7 +198,7 @@ init_syntax_once ()
#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
#ifndef NULL
-#define NULL 0
+#define NULL (void *)0
#endif
/* We remove any previous definition of `SIGN_EXTEND_CHAR',
@@ -2760,7 +2771,7 @@ at_endline_loc_p (p, pend, syntax)
{
const char *next = p;
boolean next_backslash = *next == '\\';
- const char *next_next = p + 1 < pend ? p + 1 : NULL;
+ const char *next_next = p + 1 < pend ? p + 1 : 0;
return
/* Before a subexpression? */