guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 04/06: [slog] Assume STDC_HEADERS is defined


From: Thien-Thi Nguyen
Subject: [Guile-commits] 04/06: [slog] Assume STDC_HEADERS is defined
Date: Wed, 3 Mar 2021 01:41:38 -0500 (EST)

ttn pushed a commit to branch branch_release-1-8
in repository guile.

commit 4ba2d72b3276b90e3f0d0c04df01128c08f3ab8b
Author: Thien-Thi Nguyen <ttn@gnu.org>
AuthorDate: Wed Mar 3 00:23:36 2021 -0500

    [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.
---
 configure.ac             |  4 +---
 libguile/gen-scmconfig.c | 16 ++++++++--------
 libguile/putenv.c        | 10 ----------
 3 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/configure.ac b/configure.ac
index 76a1a19..d39d1a4 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 f02f918..992bd22 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 0ff3359..31cd199 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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]