From 9cfdb3ec08672f13088ebd133bbc794c04a66b05 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 4 Jul 2011 22:27:49 -0700 Subject: [ChangeLog] Assume support for memcmp, memcpy, memmove, memset. This simplifies the code a bit. All current platforms have these, as they are required for C89. If this turns into a problem we can add the gnulib modules for these (a 1-line change to Makefile.in). * configure.in: Don't check for memcmp, memcpy, memmove, memset. [lib-src/ChangeLog] Assume support for memcmp, memcpy, memmove, memset. * etags.c (absolute_filename): Assume memmove exists. [src/ChangeLog] Assume support for memcmp, memcpy, memmove, memset. * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset): * regex.c (memcmp, memcpy): Remove; we assume C89 now. * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now. (__malloc_safe_bcopy): Remove; no longer needed. --- lib-src/ChangeLog | 5 +++++ lib-src/etags.c | 9 --------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'lib-src') diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 098ee06c762..c2b1b106c15 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2011-07-05 Paul Eggert + + Assume support for memcmp, memcpy, memmove, memset. + * etags.c (absolute_filename): Assume memmove exists. + 2011-07-02 Jason Rumney * emacsclient.c (decode_options) [WINDOWSNT]: Avoid tty mode on diff --git a/lib-src/etags.c b/lib-src/etags.c index 693c999047f..bba4b8e7267 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -6567,22 +6567,13 @@ absolute_filename (char *file, char *dir) else if (cp[0] != '/') cp = slashp; #endif -#ifdef HAVE_MEMMOVE memmove (cp, slashp + 3, strlen (slashp + 2)); -#else - /* Overlapping copy isn't really okay */ - strcpy (cp, slashp + 3); -#endif slashp = cp; continue; } else if (slashp[2] == '/' || slashp[2] == '\0') { -#ifdef HAVE_MEMMOVE memmove (slashp, slashp + 2, strlen (slashp + 1)); -#else - strcpy (slashp, slashp + 2); -#endif continue; } } -- cgit v1.2.1 From 0e926e561c259468174b16407dd7271c2c8fe904 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 6 Jul 2011 18:32:56 -0700 Subject: Assume freestanding C89 headers, string.h, stdlib.h. --- lib-src/ChangeLog | 8 ++++++++ lib-src/ebrowse.c | 4 ---- lib-src/etags.c | 25 ++----------------------- lib-src/makefile.w32-in | 2 +- lib-src/movemail.c | 2 -- lib-src/pop.c | 2 -- lib-src/update-game-score.c | 7 ------- 7 files changed, 11 insertions(+), 39 deletions(-) (limited to 'lib-src') diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 393cac2c8a0..5d95ec74277 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,13 @@ 2011-07-06 Paul Eggert + Assume freestanding C89 headers, string.h, stdlib.h. + * ebrowse.c: Include stdlib.h unconditionally. + * etags.c, update-game-score.c: + Include string.h and stdlib.h unconditionally. + * makefile.w32-in (LOCAL_CFLAGS): Don't define STDC_HEADERS. + * movemail.c, pop.c: Include string.h unconditionally. + * update-game-score.c: No need to include stdarg.h; not used. + Assume support for memcmp, memcpy, memmove, memset. * etags.c (absolute_filename): Assume memmove exists. diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 7871a804997..a997e56cc9f 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -20,11 +20,7 @@ along with GNU Emacs. If not, see . */ #include #include - -#ifdef HAVE_STDLIB_H #include -#endif - #include #include #include diff --git a/lib-src/etags.c b/lib-src/etags.c index bba4b8e7267..522c54ee4a5 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -138,9 +138,7 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; #endif /* MSDOS */ #ifdef WINDOWSNT -# include # include -# include # include # include # define MAXPATHLEN _MAX_PATH @@ -151,27 +149,6 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; # define HAVE_GETCWD # endif /* undef HAVE_GETCWD */ #else /* not WINDOWSNT */ -# ifdef STDC_HEADERS -# include -# include -# else /* no standard C headers */ - extern char *getenv (const char *); - extern char *strcpy (char *, const char *); - extern char *strncpy (char *, const char *, unsigned long); - extern char *strcat (char *, const char *); - extern char *strncat (char *, const char *, unsigned long); - extern int strcmp (const char *, const char *); - extern int strncmp (const char *, const char *, unsigned long); - extern int system (const char *); - extern unsigned long strlen (const char *); - extern void *malloc (unsigned long); - extern void *realloc (void *, unsigned long); - extern void exit (int); - extern void free (void *); - extern void *memmove (void *, const void *, unsigned long); -# define EXIT_SUCCESS 0 -# define EXIT_FAILURE 1 -# endif #endif /* !WINDOWSNT */ #include @@ -181,6 +158,8 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; # endif #endif /* HAVE_UNISTD_H */ +#include +#include #include #include #include diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in index 07f6170afe4..28f913a4df6 100644 --- a/lib-src/makefile.w32-in +++ b/lib-src/makefile.w32-in @@ -21,7 +21,7 @@ ALL = make-docfile hexl ctags etags movemail ebrowse emacsclient .PHONY: $(ALL) -LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \ +LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DNO_LDAV=1 \ -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../lib \ -I../nt/inc -I../src diff --git a/lib-src/movemail.c b/lib-src/movemail.c index e8c09f090f3..d70c655adec 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -68,9 +68,7 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_FCNTL_H #include #endif -#ifdef HAVE_STRING_H #include -#endif #include "syswait.h" #ifdef MAIL_USE_POP #include "pop.h" diff --git a/lib-src/pop.c b/lib-src/pop.c index 426b39bd1fb..a94e06fbd87 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c @@ -65,9 +65,7 @@ extern struct servent *hes_getservbyname (/* char *, char * */); #include #include #include -#ifdef STDC_HEADERS #include -#endif #include #ifdef KERBEROS diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index e95e2ce259d..284beafb9d9 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -35,12 +35,8 @@ along with GNU Emacs. If not, see . */ #include #include -#ifdef HAVE_STRING_H #include -#endif -#ifdef HAVE_STDLIB_H #include -#endif #include #include #include @@ -48,9 +44,6 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_FCNTL_H #include #endif -#ifdef STDC_HEADERS -#include -#endif #include /* Needed for SunOS4, for instance. */ -- cgit v1.2.1