1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

[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.
This commit is contained in:
Thien-Thi Nguyen 2021-03-03 00:23:36 -05:00
parent b03b0c7947
commit 4ba2d72b32
3 changed files with 9 additions and 21 deletions

View file

@ -1080,9 +1080,7 @@ AC_MSG_CHECKING([whether localtime caches TZ])
AC_CACHE_VAL([guile_cv_localtime_cache], AC_CACHE_VAL([guile_cv_localtime_cache],
[if test x$ac_cv_func_tzset = xyes; then [if test x$ac_cv_func_tzset = xyes; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h> AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
#if STDC_HEADERS #include <stdlib.h>
# include <stdlib.h>
#endif
extern char **environ; extern char **environ;
unset_TZ () unset_TZ ()
{ {

View file

@ -157,19 +157,19 @@ main (int argc, char *argv[])
#endif #endif
pf("\n"); 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 ("#define SCM_HAVE_STDC_HEADERS 1 /* 0 or 1 */\n");
pf ("#include <stdlib.h>\n"); pf ("#include <stdlib.h>\n");
# if HAVE_SYS_TYPES_H #if HAVE_SYS_TYPES_H
pf ("#include <sys/types.h>\n"); pf ("#include <sys/types.h>\n");
# endif #endif
# if HAVE_SYS_STDTYPES_H #if HAVE_SYS_STDTYPES_H
pf ("#include <sys/stdtypes.h>\n"); pf ("#include <sys/stdtypes.h>\n");
# endif #endif
pf ("#include <stddef.h>\n"); pf ("#include <stddef.h>\n");
#else /* STDC_HEADERS */
pf ("#define SCM_HAVE_STDC_HEADERS 0 /* 0 or 1 */");
#endif /* def STDC_HEADERS */
pf("\n"); pf("\n");
#ifdef HAVE_SYS_SELECT_H #ifdef HAVE_SYS_SELECT_H

View file

@ -35,17 +35,7 @@
char *malloc (); char *malloc ();
#endif /* GNU C library. */ #endif /* GNU C library. */
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <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 #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>