diff options
| author | Paul Eggert | 2011-07-06 18:32:56 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-06 18:32:56 -0700 |
| commit | 0e926e561c259468174b16407dd7271c2c8fe904 (patch) | |
| tree | 6a226d2950e17e8e117874c6714fd054600ffba6 | |
| parent | 59361254a6ea5fcfc2f1ec344665aa719fbb936f (diff) | |
| download | emacs-0e926e561c259468174b16407dd7271c2c8fe904.tar.gz emacs-0e926e561c259468174b16407dd7271c2c8fe904.zip | |
Assume freestanding C89 headers, string.h, stdlib.h.
| -rw-r--r-- | ChangeLog | 9 | ||||
| -rw-r--r-- | configure.in | 13 | ||||
| -rw-r--r-- | lib-src/ChangeLog | 8 | ||||
| -rw-r--r-- | lib-src/ebrowse.c | 4 | ||||
| -rw-r--r-- | lib-src/etags.c | 25 | ||||
| -rw-r--r-- | lib-src/makefile.w32-in | 2 | ||||
| -rw-r--r-- | lib-src/movemail.c | 2 | ||||
| -rw-r--r-- | lib-src/pop.c | 2 | ||||
| -rw-r--r-- | lib-src/update-game-score.c | 7 | ||||
| -rw-r--r-- | nt/ChangeLog | 7 | ||||
| -rw-r--r-- | nt/config.nt | 8 | ||||
| -rw-r--r-- | src/ChangeLog | 14 | ||||
| -rw-r--r-- | src/data.c | 3 | ||||
| -rw-r--r-- | src/doprnt.c | 5 | ||||
| -rw-r--r-- | src/floatfns.c | 3 | ||||
| -rw-r--r-- | src/gmalloc.c | 56 | ||||
| -rw-r--r-- | src/print.c | 3 | ||||
| -rw-r--r-- | src/regex.c | 56 | ||||
| -rw-r--r-- | src/s/aix4-2.h | 5 | ||||
| -rw-r--r-- | src/s/ms-w32.h | 5 | ||||
| -rw-r--r-- | src/sysdep.c | 2 |
21 files changed, 64 insertions, 175 deletions
| @@ -1,3 +1,12 @@ | |||
| 1 | 2011-07-07 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Assume freestanding C89 headers, string.h, stdlib.h. | ||
| 4 | Again, this simplifies the code, and all current platforms have these. | ||
| 5 | * configure.in (AC_CHECK_HEADERS): Don't check for limits.h. | ||
| 6 | (AC_HEADER_STDC): Remove. | ||
| 7 | (AC_CHECK_FUNCS): No need to check for strchr, strrchr. | ||
| 8 | (strchr, strrchr): Remove fallback macros. | ||
| 9 | |||
| 1 | 2011-07-06 Paul Eggert <eggert@cs.ucla.edu> | 10 | 2011-07-06 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 11 | ||
| 3 | Assume support for memcmp, memcpy, memmove, memset. | 12 | Assume support for memcmp, memcpy, memmove, memset. |
diff --git a/configure.in b/configure.in index e8a0b56d268..0b132007550 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -1211,7 +1211,7 @@ fi | |||
| 1211 | 1211 | ||
| 1212 | dnl checks for header files | 1212 | dnl checks for header files |
| 1213 | AC_CHECK_HEADERS(sys/select.h sys/time.h unistd.h utime.h \ | 1213 | AC_CHECK_HEADERS(sys/select.h sys/time.h unistd.h utime.h \ |
| 1214 | linux/version.h sys/systeminfo.h limits.h \ | 1214 | linux/version.h sys/systeminfo.h \ |
| 1215 | stdio_ext.h fcntl.h coff.h pty.h sys/mman.h \ | 1215 | stdio_ext.h fcntl.h coff.h pty.h sys/mman.h \ |
| 1216 | sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \ | 1216 | sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \ |
| 1217 | sys/utsname.h pwd.h utmp.h dirent.h util.h) | 1217 | sys/utsname.h pwd.h utmp.h dirent.h util.h) |
| @@ -1230,7 +1230,6 @@ fi | |||
| 1230 | dnl On Solaris 8 there's a compilation warning for term.h because | 1230 | dnl On Solaris 8 there's a compilation warning for term.h because |
| 1231 | dnl it doesn't define `bool'. | 1231 | dnl it doesn't define `bool'. |
| 1232 | AC_CHECK_HEADERS(term.h, , , -) | 1232 | AC_CHECK_HEADERS(term.h, , , -) |
| 1233 | AC_HEADER_STDC | ||
| 1234 | AC_HEADER_TIME | 1233 | AC_HEADER_TIME |
| 1235 | AC_CHECK_DECLS([sys_siglist]) | 1234 | AC_CHECK_DECLS([sys_siglist]) |
| 1236 | if test $ac_cv_have_decl_sys_siglist != yes; then | 1235 | if test $ac_cv_have_decl_sys_siglist != yes; then |
| @@ -2702,7 +2701,7 @@ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ | |||
| 2702 | random lrand48 logb frexp fmod rint cbrt ftime setsid \ | 2701 | random lrand48 logb frexp fmod rint cbrt ftime setsid \ |
| 2703 | strerror fpathconf select euidaccess getpagesize tzset setlocale \ | 2702 | strerror fpathconf select euidaccess getpagesize tzset setlocale \ |
| 2704 | utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \ | 2703 | utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \ |
| 2705 | __fpending mblen mbrlen mbsinit strsignal setitimer ualarm strchr strrchr \ | 2704 | __fpending mblen mbrlen mbsinit strsignal setitimer ualarm \ |
| 2706 | sendto recvfrom getsockopt setsockopt getsockname getpeername \ | 2705 | sendto recvfrom getsockopt setsockopt getsockname getpeername \ |
| 2707 | gai_strerror mkstemp getline getdelim mremap fsync sync \ | 2706 | gai_strerror mkstemp getline getdelim mremap fsync sync \ |
| 2708 | difftime mempcpy mblen mbrlen posix_memalign \ | 2707 | difftime mempcpy mblen mbrlen posix_memalign \ |
| @@ -3582,14 +3581,6 @@ AH_BOTTOM([ | |||
| 3582 | #include <string.h> | 3581 | #include <string.h> |
| 3583 | #include <stdlib.h> | 3582 | #include <stdlib.h> |
| 3584 | 3583 | ||
| 3585 | #ifndef HAVE_STRCHR | ||
| 3586 | #define strchr(a, b) index (a, b) | ||
| 3587 | #endif | ||
| 3588 | |||
| 3589 | #ifndef HAVE_STRRCHR | ||
| 3590 | #define strrchr(a, b) rindex (a, b) | ||
| 3591 | #endif | ||
| 3592 | |||
| 3593 | #if defined __GNUC__ && (__GNUC__ > 2 \ | 3584 | #if defined __GNUC__ && (__GNUC__ > 2 \ |
| 3594 | || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) | 3585 | || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) |
| 3595 | #define NO_RETURN __attribute__ ((__noreturn__)) | 3586 | #define NO_RETURN __attribute__ ((__noreturn__)) |
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 @@ | |||
| 1 | 2011-07-06 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-07-06 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Assume freestanding C89 headers, string.h, stdlib.h. | ||
| 4 | * ebrowse.c: Include stdlib.h unconditionally. | ||
| 5 | * etags.c, update-game-score.c: | ||
| 6 | Include string.h and stdlib.h unconditionally. | ||
| 7 | * makefile.w32-in (LOCAL_CFLAGS): Don't define STDC_HEADERS. | ||
| 8 | * movemail.c, pop.c: Include string.h unconditionally. | ||
| 9 | * update-game-score.c: No need to include stdarg.h; not used. | ||
| 10 | |||
| 3 | Assume support for memcmp, memcpy, memmove, memset. | 11 | Assume support for memcmp, memcpy, memmove, memset. |
| 4 | * etags.c (absolute_filename): Assume memmove exists. | 12 | * etags.c (absolute_filename): Assume memmove exists. |
| 5 | 13 | ||
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 <http://www.gnu.org/licenses/>. */ | |||
| 20 | 20 | ||
| 21 | #include <config.h> | 21 | #include <config.h> |
| 22 | #include <stdio.h> | 22 | #include <stdio.h> |
| 23 | |||
| 24 | #ifdef HAVE_STDLIB_H | ||
| 25 | #include <stdlib.h> | 23 | #include <stdlib.h> |
| 26 | #endif | ||
| 27 | |||
| 28 | #include <string.h> | 24 | #include <string.h> |
| 29 | #include <ctype.h> | 25 | #include <ctype.h> |
| 30 | #include <assert.h> | 26 | #include <assert.h> |
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"; | |||
| 138 | #endif /* MSDOS */ | 138 | #endif /* MSDOS */ |
| 139 | 139 | ||
| 140 | #ifdef WINDOWSNT | 140 | #ifdef WINDOWSNT |
| 141 | # include <stdlib.h> | ||
| 142 | # include <fcntl.h> | 141 | # include <fcntl.h> |
| 143 | # include <string.h> | ||
| 144 | # include <direct.h> | 142 | # include <direct.h> |
| 145 | # include <io.h> | 143 | # include <io.h> |
| 146 | # define MAXPATHLEN _MAX_PATH | 144 | # define MAXPATHLEN _MAX_PATH |
| @@ -151,27 +149,6 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; | |||
| 151 | # define HAVE_GETCWD | 149 | # define HAVE_GETCWD |
| 152 | # endif /* undef HAVE_GETCWD */ | 150 | # endif /* undef HAVE_GETCWD */ |
| 153 | #else /* not WINDOWSNT */ | 151 | #else /* not WINDOWSNT */ |
| 154 | # ifdef STDC_HEADERS | ||
| 155 | # include <stdlib.h> | ||
| 156 | # include <string.h> | ||
| 157 | # else /* no standard C headers */ | ||
| 158 | extern char *getenv (const char *); | ||
| 159 | extern char *strcpy (char *, const char *); | ||
| 160 | extern char *strncpy (char *, const char *, unsigned long); | ||
| 161 | extern char *strcat (char *, const char *); | ||
| 162 | extern char *strncat (char *, const char *, unsigned long); | ||
| 163 | extern int strcmp (const char *, const char *); | ||
| 164 | extern int strncmp (const char *, const char *, unsigned long); | ||
| 165 | extern int system (const char *); | ||
| 166 | extern unsigned long strlen (const char *); | ||
| 167 | extern void *malloc (unsigned long); | ||
| 168 | extern void *realloc (void *, unsigned long); | ||
| 169 | extern void exit (int); | ||
| 170 | extern void free (void *); | ||
| 171 | extern void *memmove (void *, const void *, unsigned long); | ||
| 172 | # define EXIT_SUCCESS 0 | ||
| 173 | # define EXIT_FAILURE 1 | ||
| 174 | # endif | ||
| 175 | #endif /* !WINDOWSNT */ | 152 | #endif /* !WINDOWSNT */ |
| 176 | 153 | ||
| 177 | #include <unistd.h> | 154 | #include <unistd.h> |
| @@ -181,6 +158,8 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; | |||
| 181 | # endif | 158 | # endif |
| 182 | #endif /* HAVE_UNISTD_H */ | 159 | #endif /* HAVE_UNISTD_H */ |
| 183 | 160 | ||
| 161 | #include <stdlib.h> | ||
| 162 | #include <string.h> | ||
| 184 | #include <stdio.h> | 163 | #include <stdio.h> |
| 185 | #include <ctype.h> | 164 | #include <ctype.h> |
| 186 | #include <errno.h> | 165 | #include <errno.h> |
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 | |||
| 21 | 21 | ||
| 22 | .PHONY: $(ALL) | 22 | .PHONY: $(ALL) |
| 23 | 23 | ||
| 24 | LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \ | 24 | LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DNO_LDAV=1 \ |
| 25 | -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../lib \ | 25 | -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../lib \ |
| 26 | -I../nt/inc -I../src | 26 | -I../nt/inc -I../src |
| 27 | 27 | ||
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 <http://www.gnu.org/licenses/>. */ | |||
| 68 | #ifdef HAVE_FCNTL_H | 68 | #ifdef HAVE_FCNTL_H |
| 69 | #include <fcntl.h> | 69 | #include <fcntl.h> |
| 70 | #endif | 70 | #endif |
| 71 | #ifdef HAVE_STRING_H | ||
| 72 | #include <string.h> | 71 | #include <string.h> |
| 73 | #endif | ||
| 74 | #include "syswait.h" | 72 | #include "syswait.h" |
| 75 | #ifdef MAIL_USE_POP | 73 | #ifdef MAIL_USE_POP |
| 76 | #include "pop.h" | 74 | #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 * */); | |||
| 65 | #include <netdb.h> | 65 | #include <netdb.h> |
| 66 | #include <errno.h> | 66 | #include <errno.h> |
| 67 | #include <stdio.h> | 67 | #include <stdio.h> |
| 68 | #ifdef STDC_HEADERS | ||
| 69 | #include <string.h> | 68 | #include <string.h> |
| 70 | #endif | ||
| 71 | #include <unistd.h> | 69 | #include <unistd.h> |
| 72 | 70 | ||
| 73 | #ifdef KERBEROS | 71 | #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 <http://www.gnu.org/licenses/>. */ | |||
| 35 | 35 | ||
| 36 | #include <unistd.h> | 36 | #include <unistd.h> |
| 37 | #include <errno.h> | 37 | #include <errno.h> |
| 38 | #ifdef HAVE_STRING_H | ||
| 39 | #include <string.h> | 38 | #include <string.h> |
| 40 | #endif | ||
| 41 | #ifdef HAVE_STDLIB_H | ||
| 42 | #include <stdlib.h> | 39 | #include <stdlib.h> |
| 43 | #endif | ||
| 44 | #include <stdio.h> | 40 | #include <stdio.h> |
| 45 | #include <time.h> | 41 | #include <time.h> |
| 46 | #include <pwd.h> | 42 | #include <pwd.h> |
| @@ -48,9 +44,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 48 | #ifdef HAVE_FCNTL_H | 44 | #ifdef HAVE_FCNTL_H |
| 49 | #include <fcntl.h> | 45 | #include <fcntl.h> |
| 50 | #endif | 46 | #endif |
| 51 | #ifdef STDC_HEADERS | ||
| 52 | #include <stdarg.h> | ||
| 53 | #endif | ||
| 54 | #include <sys/stat.h> | 47 | #include <sys/stat.h> |
| 55 | 48 | ||
| 56 | /* Needed for SunOS4, for instance. */ | 49 | /* Needed for SunOS4, for instance. */ |
diff --git a/nt/ChangeLog b/nt/ChangeLog index 087f006b88b..68a68d95309 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-07-07 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Assume freestanding C89 headers, string.h, stdlib.h. | ||
| 4 | * config.nt (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H) | ||
| 5 | (STDC_HEADERS): Remove. | ||
| 6 | Iinclude string.h, stdlib.h unconditionally. | ||
| 7 | |||
| 1 | 2011-06-07 Eli Zaretskii <eliz@gnu.org> | 8 | 2011-06-07 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | * inc/stdint.h (INT32_MAX, INT64_MAX, INTPTR_MAX, PTRDIFF_MAX) | 10 | * inc/stdint.h (INT32_MAX, INT64_MAX, INTPTR_MAX, PTRDIFF_MAX) |
diff --git a/nt/config.nt b/nt/config.nt index 2ba76df4446..3436bc989e0 100644 --- a/nt/config.nt +++ b/nt/config.nt | |||
| @@ -131,12 +131,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 131 | #undef HAVE_LINUX_VERSION_H | 131 | #undef HAVE_LINUX_VERSION_H |
| 132 | #undef HAVE_SYS_SYSTEMINFO_H | 132 | #undef HAVE_SYS_SYSTEMINFO_H |
| 133 | #undef HAVE_TERMIOS_H | 133 | #undef HAVE_TERMIOS_H |
| 134 | #undef HAVE_LIMITS_H | ||
| 135 | #undef HAVE_STRING_H | ||
| 136 | #undef HAVE_STRINGS_H | 134 | #undef HAVE_STRINGS_H |
| 137 | #undef HAVE_STDLIB_H | ||
| 138 | #undef HAVE_PWD_H | 135 | #undef HAVE_PWD_H |
| 139 | #undef STDC_HEADERS | ||
| 140 | 136 | ||
| 141 | #undef HAVE_LIBDNET | 137 | #undef HAVE_LIBDNET |
| 142 | #undef HAVE_LIBPTHREADS | 138 | #undef HAVE_LIBPTHREADS |
| @@ -506,15 +502,11 @@ extern char *getenv (); | |||
| 506 | #define PROTOTYPES 1 | 502 | #define PROTOTYPES 1 |
| 507 | #endif | 503 | #endif |
| 508 | 504 | ||
| 509 | #ifdef HAVE_STRING_H | ||
| 510 | #include "string.h" | 505 | #include "string.h" |
| 511 | #endif | ||
| 512 | #ifdef HAVE_STRINGS_H | 506 | #ifdef HAVE_STRINGS_H |
| 513 | #include "strings.h" | 507 | #include "strings.h" |
| 514 | #endif | 508 | #endif |
| 515 | #ifdef HAVE_STDLIB_H | ||
| 516 | #include <stdlib.h> | 509 | #include <stdlib.h> |
| 517 | #endif | ||
| 518 | 510 | ||
| 519 | #ifndef NO_RETURN | 511 | #ifndef NO_RETURN |
| 520 | #if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR >= 5)) | 512 | #if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR >= 5)) |
diff --git a/src/ChangeLog b/src/ChangeLog index b0fb0f213ab..d91837877e1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2011-07-07 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Assume freestanding C89 headers, string.h, stdlib.h. | ||
| 4 | * data.c, doprnt.c, floatfns.c, print.c: | ||
| 5 | Include float.h unconditionally. | ||
| 6 | * gmalloc.c: Assume C89-at-least behavior for preprocessor, | ||
| 7 | limits.h, stddef.h, string.h. Use memset instead of 'flood'. | ||
| 8 | * regex.c: Likewise for stddef.h, string.h. | ||
| 9 | (ISASCII): Remove; can assume it returns 1 now. All uses removed. | ||
| 10 | * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef. | ||
| 11 | * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H) | ||
| 12 | (STDC_HEADERS): Remove obsolete defines. | ||
| 13 | * sysdep.c: Include limits.h unconditionally. | ||
| 14 | |||
| 1 | 2011-07-06 Paul Eggert <eggert@cs.ucla.edu> | 15 | 2011-07-06 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 16 | ||
| 3 | Assume support for memcmp, memcpy, memmove, memset. | 17 | Assume support for memcmp, memcpy, memmove, memset. |
diff --git a/src/data.c b/src/data.c index 6b4ea32ac9e..eb3f870b97c 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -35,10 +35,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 35 | #include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */ | 35 | #include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */ |
| 36 | #include "font.h" | 36 | #include "font.h" |
| 37 | 37 | ||
| 38 | #ifdef STDC_HEADERS | ||
| 39 | #include <float.h> | 38 | #include <float.h> |
| 40 | #endif | ||
| 41 | |||
| 42 | /* If IEEE_FLOATING_POINT isn't defined, default it from FLT_*. */ | 39 | /* If IEEE_FLOATING_POINT isn't defined, default it from FLT_*. */ |
| 43 | #ifndef IEEE_FLOATING_POINT | 40 | #ifndef IEEE_FLOATING_POINT |
| 44 | #if (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \ | 41 | #if (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \ |
diff --git a/src/doprnt.c b/src/doprnt.c index 195598c07ea..0632046525a 100644 --- a/src/doprnt.c +++ b/src/doprnt.c | |||
| @@ -102,13 +102,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 102 | #include <stdio.h> | 102 | #include <stdio.h> |
| 103 | #include <ctype.h> | 103 | #include <ctype.h> |
| 104 | #include <setjmp.h> | 104 | #include <setjmp.h> |
| 105 | |||
| 106 | #ifdef STDC_HEADERS | ||
| 107 | #include <float.h> | 105 | #include <float.h> |
| 108 | #endif | ||
| 109 | |||
| 110 | #include <unistd.h> | 106 | #include <unistd.h> |
| 111 | |||
| 112 | #include <limits.h> | 107 | #include <limits.h> |
| 113 | 108 | ||
| 114 | #include "lisp.h" | 109 | #include "lisp.h" |
diff --git a/src/floatfns.c b/src/floatfns.c index b5c8b4af5c3..850eb9f1bcc 100644 --- a/src/floatfns.c +++ b/src/floatfns.c | |||
| @@ -53,10 +53,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 53 | #include "lisp.h" | 53 | #include "lisp.h" |
| 54 | #include "syssignal.h" | 54 | #include "syssignal.h" |
| 55 | 55 | ||
| 56 | #if STDC_HEADERS | ||
| 57 | #include <float.h> | 56 | #include <float.h> |
| 58 | #endif | ||
| 59 | |||
| 60 | /* If IEEE_FLOATING_POINT isn't defined, default it from FLT_*. */ | 57 | /* If IEEE_FLOATING_POINT isn't defined, default it from FLT_*. */ |
| 61 | #ifndef IEEE_FLOATING_POINT | 58 | #ifndef IEEE_FLOATING_POINT |
| 62 | #if (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \ | 59 | #if (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \ |
diff --git a/src/gmalloc.c b/src/gmalloc.c index 4f27ea3079a..fa4aa1fdf6a 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c | |||
| @@ -41,28 +41,13 @@ Fifth Floor, Boston, MA 02110-1301, USA. | |||
| 41 | #define USE_PTHREAD | 41 | #define USE_PTHREAD |
| 42 | #endif | 42 | #endif |
| 43 | 43 | ||
| 44 | #if ((defined __cplusplus || (defined (__STDC__) && __STDC__) \ | ||
| 45 | || defined STDC_HEADERS || defined PROTOTYPES)) | ||
| 46 | #undef PP | 44 | #undef PP |
| 47 | #define PP(args) args | 45 | #define PP(args) args |
| 48 | #undef __ptr_t | 46 | #undef __ptr_t |
| 49 | #define __ptr_t void * | 47 | #define __ptr_t void * |
| 50 | #else /* Not C++ or ANSI C. */ | ||
| 51 | #undef PP | ||
| 52 | #define PP(args) () | ||
| 53 | #undef __ptr_t | ||
| 54 | #define __ptr_t char * | ||
| 55 | #endif /* C++ or ANSI C. */ | ||
| 56 | 48 | ||
| 57 | #include <string.h> | 49 | #include <string.h> |
| 58 | |||
| 59 | #ifdef HAVE_LIMITS_H | ||
| 60 | #include <limits.h> | 50 | #include <limits.h> |
| 61 | #endif | ||
| 62 | #ifndef CHAR_BIT | ||
| 63 | #define CHAR_BIT 8 | ||
| 64 | #endif | ||
| 65 | |||
| 66 | #include <unistd.h> | 51 | #include <unistd.h> |
| 67 | 52 | ||
| 68 | #ifdef USE_PTHREAD | 53 | #ifdef USE_PTHREAD |
| @@ -77,26 +62,9 @@ extern "C" | |||
| 77 | { | 62 | { |
| 78 | #endif | 63 | #endif |
| 79 | 64 | ||
| 80 | #ifdef STDC_HEADERS | ||
| 81 | #include <stddef.h> | 65 | #include <stddef.h> |
| 82 | #define __malloc_size_t size_t | 66 | #define __malloc_size_t size_t |
| 83 | #define __malloc_ptrdiff_t ptrdiff_t | 67 | #define __malloc_ptrdiff_t ptrdiff_t |
| 84 | #else | ||
| 85 | #ifdef __GNUC__ | ||
| 86 | #include <stddef.h> | ||
| 87 | #ifdef __SIZE_TYPE__ | ||
| 88 | #define __malloc_size_t __SIZE_TYPE__ | ||
| 89 | #endif | ||
| 90 | #endif | ||
| 91 | #ifndef __malloc_size_t | ||
| 92 | #define __malloc_size_t unsigned int | ||
| 93 | #endif | ||
| 94 | #define __malloc_ptrdiff_t int | ||
| 95 | #endif | ||
| 96 | |||
| 97 | #ifndef NULL | ||
| 98 | #define NULL 0 | ||
| 99 | #endif | ||
| 100 | 68 | ||
| 101 | 69 | ||
| 102 | /* Allocate SIZE bytes of memory. */ | 70 | /* Allocate SIZE bytes of memory. */ |
| @@ -1881,22 +1849,6 @@ struct hdr | |||
| 1881 | unsigned long int magic; /* Magic number to check header integrity. */ | 1849 | unsigned long int magic; /* Magic number to check header integrity. */ |
| 1882 | }; | 1850 | }; |
| 1883 | 1851 | ||
| 1884 | #if defined(_LIBC) || defined(STDC_HEADERS) || defined(USG) | ||
| 1885 | #define flood memset | ||
| 1886 | #else | ||
| 1887 | static void flood (__ptr_t, int, __malloc_size_t); | ||
| 1888 | static void | ||
| 1889 | flood (ptr, val, size) | ||
| 1890 | __ptr_t ptr; | ||
| 1891 | int val; | ||
| 1892 | __malloc_size_t size; | ||
| 1893 | { | ||
| 1894 | char *cp = ptr; | ||
| 1895 | while (size--) | ||
| 1896 | *cp++ = val; | ||
| 1897 | } | ||
| 1898 | #endif | ||
| 1899 | |||
| 1900 | static enum mcheck_status checkhdr (const struct hdr *); | 1852 | static enum mcheck_status checkhdr (const struct hdr *); |
| 1901 | static enum mcheck_status | 1853 | static enum mcheck_status |
| 1902 | checkhdr (hdr) | 1854 | checkhdr (hdr) |
| @@ -1935,7 +1887,7 @@ freehook (ptr) | |||
| 1935 | hdr = ((struct hdr *) ptr) - 1; | 1887 | hdr = ((struct hdr *) ptr) - 1; |
| 1936 | checkhdr (hdr); | 1888 | checkhdr (hdr); |
| 1937 | hdr->magic = MAGICFREE; | 1889 | hdr->magic = MAGICFREE; |
| 1938 | flood (ptr, FREEFLOOD, hdr->size); | 1890 | memset (ptr, FREEFLOOD, hdr->size); |
| 1939 | } | 1891 | } |
| 1940 | else | 1892 | else |
| 1941 | hdr = NULL; | 1893 | hdr = NULL; |
| @@ -1961,7 +1913,7 @@ mallochook (size) | |||
| 1961 | hdr->size = size; | 1913 | hdr->size = size; |
| 1962 | hdr->magic = MAGICWORD; | 1914 | hdr->magic = MAGICWORD; |
| 1963 | ((char *) &hdr[1])[size] = MAGICBYTE; | 1915 | ((char *) &hdr[1])[size] = MAGICBYTE; |
| 1964 | flood ((__ptr_t) (hdr + 1), MALLOCFLOOD, size); | 1916 | memset ((__ptr_t) (hdr + 1), MALLOCFLOOD, size); |
| 1965 | return (__ptr_t) (hdr + 1); | 1917 | return (__ptr_t) (hdr + 1); |
| 1966 | } | 1918 | } |
| 1967 | 1919 | ||
| @@ -1981,7 +1933,7 @@ reallochook (ptr, size) | |||
| 1981 | 1933 | ||
| 1982 | checkhdr (hdr); | 1934 | checkhdr (hdr); |
| 1983 | if (size < osize) | 1935 | if (size < osize) |
| 1984 | flood ((char *) ptr + size, FREEFLOOD, osize - size); | 1936 | memset ((char *) ptr + size, FREEFLOOD, osize - size); |
| 1985 | } | 1937 | } |
| 1986 | 1938 | ||
| 1987 | __free_hook = old_free_hook; | 1939 | __free_hook = old_free_hook; |
| @@ -1998,7 +1950,7 @@ reallochook (ptr, size) | |||
| 1998 | hdr->magic = MAGICWORD; | 1950 | hdr->magic = MAGICWORD; |
| 1999 | ((char *) &hdr[1])[size] = MAGICBYTE; | 1951 | ((char *) &hdr[1])[size] = MAGICBYTE; |
| 2000 | if (size > osize) | 1952 | if (size > osize) |
| 2001 | flood ((char *) (hdr + 1) + osize, MALLOCFLOOD, size - osize); | 1953 | memset ((char *) (hdr + 1) + osize, MALLOCFLOOD, size - osize); |
| 2002 | return (__ptr_t) (hdr + 1); | 1954 | return (__ptr_t) (hdr + 1); |
| 2003 | } | 1955 | } |
| 2004 | 1956 | ||
diff --git a/src/print.c b/src/print.c index 14b4326bb6f..f1907a31465 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -46,10 +46,7 @@ static Lisp_Object Qtemp_buffer_setup_hook; | |||
| 46 | static Lisp_Object Qfloat_output_format; | 46 | static Lisp_Object Qfloat_output_format; |
| 47 | 47 | ||
| 48 | #include <math.h> | 48 | #include <math.h> |
| 49 | |||
| 50 | #if STDC_HEADERS | ||
| 51 | #include <float.h> | 49 | #include <float.h> |
| 52 | #endif | ||
| 53 | #include <ftoastr.h> | 50 | #include <ftoastr.h> |
| 54 | 51 | ||
| 55 | /* Default to values appropriate for IEEE floating point. */ | 52 | /* Default to values appropriate for IEEE floating point. */ |
diff --git a/src/regex.c b/src/regex.c index f514b603488..d347d274819 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -37,9 +37,9 @@ | |||
| 37 | # include <config.h> | 37 | # include <config.h> |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | #if defined STDC_HEADERS && !defined emacs | 40 | #include <stddef.h> |
| 41 | # include <stddef.h> | 41 | |
| 42 | #else | 42 | #ifdef emacs |
| 43 | /* We need this for `regex.h', and perhaps for the Emacs include files. */ | 43 | /* We need this for `regex.h', and perhaps for the Emacs include files. */ |
| 44 | # include <sys/types.h> | 44 | # include <sys/types.h> |
| 45 | #endif | 45 | #endif |
| @@ -346,25 +346,6 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; | |||
| 346 | 346 | ||
| 347 | #else /* not emacs */ | 347 | #else /* not emacs */ |
| 348 | 348 | ||
| 349 | /* Jim Meyering writes: | ||
| 350 | |||
| 351 | "... Some ctype macros are valid only for character codes that | ||
| 352 | isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when | ||
| 353 | using /bin/cc or gcc but without giving an ansi option). So, all | ||
| 354 | ctype uses should be through macros like ISPRINT... If | ||
| 355 | STDC_HEADERS is defined, then autoconf has verified that the ctype | ||
| 356 | macros don't need to be guarded with references to isascii. ... | ||
| 357 | Defining isascii to 1 should let any compiler worth its salt | ||
| 358 | eliminate the && through constant folding." | ||
| 359 | Solaris defines some of these symbols so we must undefine them first. */ | ||
| 360 | |||
| 361 | # undef ISASCII | ||
| 362 | # if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII) | ||
| 363 | # define ISASCII(c) 1 | ||
| 364 | # else | ||
| 365 | # define ISASCII(c) isascii(c) | ||
| 366 | # endif | ||
| 367 | |||
| 368 | /* 1 if C is an ASCII character. */ | 349 | /* 1 if C is an ASCII character. */ |
| 369 | # define IS_REAL_ASCII(c) ((c) < 0200) | 350 | # define IS_REAL_ASCII(c) ((c) < 0200) |
| 370 | 351 | ||
| @@ -372,27 +353,28 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; | |||
| 372 | # define ISUNIBYTE(c) 1 | 353 | # define ISUNIBYTE(c) 1 |
| 373 | 354 | ||
| 374 | # ifdef isblank | 355 | # ifdef isblank |
| 375 | # define ISBLANK(c) (ISASCII (c) && isblank (c)) | 356 | # define ISBLANK(c) isblank (c) |
| 376 | # else | 357 | # else |
| 377 | # define ISBLANK(c) ((c) == ' ' || (c) == '\t') | 358 | # define ISBLANK(c) ((c) == ' ' || (c) == '\t') |
| 378 | # endif | 359 | # endif |
| 379 | # ifdef isgraph | 360 | # ifdef isgraph |
| 380 | # define ISGRAPH(c) (ISASCII (c) && isgraph (c)) | 361 | # define ISGRAPH(c) isgraph (c) |
| 381 | # else | 362 | # else |
| 382 | # define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) | 363 | # define ISGRAPH(c) (isprint (c) && !isspace (c)) |
| 383 | # endif | 364 | # endif |
| 384 | 365 | ||
| 366 | /* Solaris defines ISPRINT so we must undefine it first. */ | ||
| 385 | # undef ISPRINT | 367 | # undef ISPRINT |
| 386 | # define ISPRINT(c) (ISASCII (c) && isprint (c)) | 368 | # define ISPRINT(c) isprint (c) |
| 387 | # define ISDIGIT(c) (ISASCII (c) && isdigit (c)) | 369 | # define ISDIGIT(c) isdigit (c) |
| 388 | # define ISALNUM(c) (ISASCII (c) && isalnum (c)) | 370 | # define ISALNUM(c) isalnum (c) |
| 389 | # define ISALPHA(c) (ISASCII (c) && isalpha (c)) | 371 | # define ISALPHA(c) isalpha (c) |
| 390 | # define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) | 372 | # define ISCNTRL(c) iscntrl (c) |
| 391 | # define ISLOWER(c) (ISASCII (c) && islower (c)) | 373 | # define ISLOWER(c) islower (c) |
| 392 | # define ISPUNCT(c) (ISASCII (c) && ispunct (c)) | 374 | # define ISPUNCT(c) ispunct (c) |
| 393 | # define ISSPACE(c) (ISASCII (c) && isspace (c)) | 375 | # define ISSPACE(c) isspace (c) |
| 394 | # define ISUPPER(c) (ISASCII (c) && isupper (c)) | 376 | # define ISUPPER(c) isupper (c) |
| 395 | # define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) | 377 | # define ISXDIGIT(c) isxdigit (c) |
| 396 | 378 | ||
| 397 | # define ISWORD(c) ISALPHA(c) | 379 | # define ISWORD(c) ISALPHA(c) |
| 398 | 380 | ||
| @@ -439,10 +421,6 @@ init_syntax_once (void) | |||
| 439 | 421 | ||
| 440 | #endif /* not emacs */ | 422 | #endif /* not emacs */ |
| 441 | 423 | ||
| 442 | #ifndef NULL | ||
| 443 | # define NULL (void *)0 | ||
| 444 | #endif | ||
| 445 | |||
| 446 | /* We remove any previous definition of `SIGN_EXTEND_CHAR', | 424 | /* We remove any previous definition of `SIGN_EXTEND_CHAR', |
| 447 | since ours (we hope) works properly with all combinations of | 425 | since ours (we hope) works properly with all combinations of |
| 448 | machines, compilers, `char' and `unsigned char' argument types. | 426 | machines, compilers, `char' and `unsigned char' argument types. |
diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index c2715fffe01..b44bd0308a3 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h | |||
| @@ -47,11 +47,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 47 | /* AIX doesn't define this. */ | 47 | /* AIX doesn't define this. */ |
| 48 | #define unix 1 | 48 | #define unix 1 |
| 49 | 49 | ||
| 50 | /* string.h defines rindex as a macro, at least with native cc, so we | ||
| 51 | lose declaring char * rindex without this. | ||
| 52 | It is just a guess which versions of AIX need this definition. */ | ||
| 53 | #undef HAVE_STRING_H | ||
| 54 | |||
| 55 | /* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct. */ | 50 | /* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct. */ |
| 56 | #define SIGNALS_VIA_CHARACTERS | 51 | #define SIGNALS_VIA_CHARACTERS |
| 57 | #define CLASH_DETECTION | 52 | #define CLASH_DETECTION |
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index bf6cc66798c..813c3cef115 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h | |||
| @@ -111,11 +111,7 @@ struct sigaction { | |||
| 111 | #undef HAVE_UTIME_H | 111 | #undef HAVE_UTIME_H |
| 112 | #undef HAVE_LINUX_VERSION_H | 112 | #undef HAVE_LINUX_VERSION_H |
| 113 | #undef HAVE_SYS_SYSTEMINFO_H | 113 | #undef HAVE_SYS_SYSTEMINFO_H |
| 114 | #define HAVE_LIMITS_H 1 | ||
| 115 | #define HAVE_STRING_H 1 | ||
| 116 | #define HAVE_STDLIB_H 1 | ||
| 117 | #define HAVE_PWD_H 1 | 114 | #define HAVE_PWD_H 1 |
| 118 | #define STDC_HEADERS 1 | ||
| 119 | #define TIME_WITH_SYS_TIME 1 | 115 | #define TIME_WITH_SYS_TIME 1 |
| 120 | 116 | ||
| 121 | #define HAVE_GETTIMEOFDAY 1 | 117 | #define HAVE_GETTIMEOFDAY 1 |
| @@ -386,4 +382,3 @@ extern void _DebPrint (const char *fmt, ...); | |||
| 386 | 382 | ||
| 387 | 383 | ||
| 388 | /* ============================================================ */ | 384 | /* ============================================================ */ |
| 389 | |||
diff --git a/src/sysdep.c b/src/sysdep.c index f157baf3e76..155d577ebfa 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -26,9 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | #include <pwd.h> | 26 | #include <pwd.h> |
| 27 | #include <grp.h> | 27 | #include <grp.h> |
| 28 | #endif /* HAVE_PWD_H */ | 28 | #endif /* HAVE_PWD_H */ |
| 29 | #ifdef HAVE_LIMITS_H | ||
| 30 | #include <limits.h> | 29 | #include <limits.h> |
| 31 | #endif /* HAVE_LIMITS_H */ | ||
| 32 | #include <unistd.h> | 30 | #include <unistd.h> |
| 33 | 31 | ||
| 34 | #include <allocator.h> | 32 | #include <allocator.h> |