diff options
author | Thien-Thi Nguyen <ttn@gnu.org> | 2021-03-03 00:23:36 -0500 |
---|---|---|
committer | Thien-Thi Nguyen <ttn@gnu.org> | 2021-03-03 00:23:36 -0500 |
commit | 4ba2d72b3276b90e3f0d0c04df01128c08f3ab8b (patch) | |
tree | b778746d8803077252e1d91498db9f4be50f1516 | |
parent | b03b0c7947a2977406892ff63a2aadbe6c2b5a7d (diff) | |
download | guile-4ba2d72b3276b90e3f0d0c04df01128c08f3ab8b.tar.gz |
[slog] Assume STDC_HEADERS is defined
* configure.ac (guile_cv_localtime_cache): Rewrite
preprocessor conditional block, assuming STDC_HEADERS is 1.
* libguile/gen-scmconfig.c (SCM_HAVE_STDC_HEADERS):
#define to 1 unconditionally.
Rewrite preprocessor conditional block,
assuming STDC_HEADERS is 1.
* libguile/putenv.c: Rewrite preprocessor conditional block,
assuming STDC_HEADERS is 1.
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | libguile/gen-scmconfig.c | 16 | ||||
-rw-r--r-- | libguile/putenv.c | 10 |
3 files changed, 9 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac index 76a1a1971..d39d1a483 100644 --- a/configure.ac +++ b/configure.ac @@ -1080,9 +1080,7 @@ AC_MSG_CHECKING([whether localtime caches TZ]) AC_CACHE_VAL([guile_cv_localtime_cache], [if test x$ac_cv_func_tzset = xyes; then AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h> -#if STDC_HEADERS -# include <stdlib.h> -#endif +#include <stdlib.h> extern char **environ; unset_TZ () { diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c index f02f91889..992bd2265 100644 --- a/libguile/gen-scmconfig.c +++ b/libguile/gen-scmconfig.c @@ -157,19 +157,19 @@ main (int argc, char *argv[]) #endif pf("\n"); -#ifdef STDC_HEADERS + /* The configure script used to check for and define STDC_HEADERS + conditionally. Nowadays that is "obsolescent" + (info "(autoconf) Particular Headers") + but we define SCM_HAVE_STDC_HEADERS anyway for backward compat. */ pf ("#define SCM_HAVE_STDC_HEADERS 1 /* 0 or 1 */\n"); pf ("#include <stdlib.h>\n"); -# if HAVE_SYS_TYPES_H +#if HAVE_SYS_TYPES_H pf ("#include <sys/types.h>\n"); -# endif -# if HAVE_SYS_STDTYPES_H +#endif +#if HAVE_SYS_STDTYPES_H pf ("#include <sys/stdtypes.h>\n"); -# endif +#endif pf ("#include <stddef.h>\n"); -#else /* STDC_HEADERS */ - pf ("#define SCM_HAVE_STDC_HEADERS 0 /* 0 or 1 */"); -#endif /* def STDC_HEADERS */ pf("\n"); #ifdef HAVE_SYS_SELECT_H diff --git a/libguile/putenv.c b/libguile/putenv.c index 0ff33592a..31cd19951 100644 --- a/libguile/putenv.c +++ b/libguile/putenv.c @@ -35,17 +35,7 @@ char *malloc (); #endif /* GNU C library. */ -#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include <string.h> -#else -#include <strings.h> -#ifndef strchr -#define strchr index -#endif -#ifndef memcpy -#define memcpy(d, s, n) bcopy((s), (d), (n)) -#endif -#endif #ifdef HAVE_UNISTD_H #include <unistd.h> |