From a847af86f51bca4cc75993a6c7c3fbee952391a9 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 28 Aug 2000 15:03:29 +0000 Subject: [PATCH] (toplevel) [HAVE_STRING_H]: Include string.h. (toplevel) [HAVE_STRINGS_H]: Include strings.h. (index): Remove prototypes which might conflict with non-standard definitions of index/strchr. --- src/callint.c | 10 ++++++++-- src/doc.c | 17 +++++++++++------ src/editfns.c | 11 ++++++++--- src/emacs.c | 9 ++++++++- 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/callint.c b/src/callint.c index 09c22a987c1..88743b83980 100644 --- a/src/callint.c +++ b/src/callint.c @@ -27,7 +27,13 @@ Boston, MA 02111-1307, USA. */ #include "window.h" #include "mocklisp.h" -extern char *index (); +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef HAVE_STRINGS_H +#include +#endif extern Lisp_Object Qcursor_in_echo_area; @@ -449,7 +455,7 @@ supply if the command inquires which events were used to invoke it.") { strncpy (prompt1, tem + 1, sizeof prompt1 - 1); prompt1[sizeof prompt1 - 1] = 0; - tem1 = index (prompt1, '\n'); + tem1 = (char *) index (prompt1, '\n'); if (tem1) *tem1 = 0; /* Fill argstrings with a vector of C strings corresponding to the Lisp strings in visargs. */ diff --git a/src/doc.c b/src/doc.c index 2cff57bb81d..52545c1f3fc 100644 --- a/src/doc.c +++ b/src/doc.c @@ -41,12 +41,18 @@ Boston, MA 02111-1307, USA. */ #include "keyboard.h" #include "charset.h" +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef HAVE_STRINGS_H +#include +#endif + Lisp_Object Vdoc_file_name, Vhelp_manyarg_func_alist; Lisp_Object Qfunction_documentation; -extern char *index (); - extern Lisp_Object Voverriding_local_map; /* For VMS versions with limited file name syntax, @@ -228,9 +234,9 @@ get_doc_string (filepos, unibyte, definition) if (!nread) break; if (p == get_doc_string_buffer) - p1 = index (p + offset, '\037'); + p1 = (char *) index (p + offset, '\037'); else - p1 = index (p, '\037'); + p1 = (char *) index (p, '\037'); if (p1) { *p1 = 0; @@ -475,7 +481,6 @@ when doc strings are referred to later in the dumped Emacs.") register char *p, *end; Lisp_Object sym, fun, tem; char *name; - extern char *index (); #ifndef CANNOT_DUMP if (NILP (Vpurify_flag)) @@ -532,7 +537,7 @@ when doc strings are referred to later in the dumped Emacs.") /* p points to ^_Ffunctionname\n or ^_Vvarname\n. */ if (p != end) { - end = index (p, '\n'); + end = (char *) index (p, '\n'); sym = oblookup (Vobarray, p + 2, multibyte_chars_in_text (p + 2, end - p - 2), end - p - 2); diff --git a/src/editfns.c b/src/editfns.c index b4044d2bb78..c8011c8eb3e 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -42,6 +42,14 @@ Boston, MA 02111-1307, USA. */ #include "systime.h" +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef HAVE_STRINGS_H +#include +#endif + #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) @@ -1138,7 +1146,6 @@ name, or nil if there is no such user.") { struct passwd *pw; register unsigned char *p, *q; - extern char *index (); Lisp_Object full; if (NILP (uid)) @@ -3018,8 +3025,6 @@ Use %% to put a single % into the output.") int start, end; } *info = 0; - extern char *index (); - /* It should not be necessary to GCPRO ARGS, because the caller in the interpreter should take care of that. */ diff --git a/src/emacs.c b/src/emacs.c index 8527736cb03..e91fca2eb01 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -60,6 +60,14 @@ Boston, MA 02111-1307, USA. */ #include #endif +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef HAVE_STRINGS_H +#include +#endif + #ifndef O_RDWR #define O_RDWR 2 #endif @@ -73,7 +81,6 @@ Boston, MA 02111-1307, USA. */ extern void malloc_warning P_ ((char *)); extern void set_time_zone_rule P_ ((char *)); -extern char *index P_ ((const char *, int)); /* Make these values available in GDB, which doesn't see macros. */ -- 2.39.2