guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 06/09: Presume ISO C90 headers are always available


From: Mike Gran
Subject: [Guile-commits] 06/09: Presume ISO C90 headers are always available
Date: Fri, 16 Sep 2022 00:44:04 -0400 (EDT)

mike121 pushed a commit to branch wip-modernize-autotools
in repository guile.

commit 7cb5d66f8b0215bec198e780c53bddad09f7509b
Author: Mike Gran <spk121@yahoo.com>
AuthorDate: Thu Sep 15 20:51:05 2022 -0700

    Presume ISO C90 headers are always available
    
    This includes <assert.h>, <ctype.h>, <errno.h>, <float.h>, <iso646.h>,
    <limits.h>, <locale.h>, <math.h>, <setjmp.h>, <signal.h>, <stdarg.h>,
    <stddef.h>, <stdio.h>, <stdlib.h>, <string.h>, <time.h>, <wchar.h>,
    and <wctype.h>.
    
    * configure.ac: don't check for <limits.h>, <string.h>, <time.h>, 
<assert.h>.
       Remove AC_INCLUDES_DEFAULT macro
    * libguile/bytevectors.c: include <limits.h>, remove HAVE_LIMITS_H
    * libguile/filesys.c: include <string.h>, remove HAVE_STRING_H
    * libguile/fports.c: include <string.h>, remove HAVE_STRING_H
    * libguile/gen-scmconfig.c: remove HAVE_LIMITS_H, HAVE_TIME_H, STDC_HEADERS
        Remove SCM_HAVE_STDC_HEADERS
    * libguile/hash.c: include <wchar.h>, remove HAVE_WCHAR_H
    * libguile/net_db.c: include <string.h>, remove HAVE_STRING_H
    * libguile/numbers.h: remove SCM_HAVE_STDC_HEADERS
    * libguile/regex-posix.c: include <wchar.h>, remove HAVE_WCHAR_H
      (fixup_multibyte_match): always defined
      (scm_regexp_exec): use fixup_multibyte_match
    * libguile/scmsigs.c: remove STDC_HEADERS
    * libguile/socket.c: include <string.h>, remove HAVE_STRING_H
    * test-suite/standalone/test-unwind.c: include <string.h>, remove 
HAVE_STRING_H
---
 configure.ac                        | 17 ++++++++---------
 libguile/bytevectors.c              |  5 +----
 libguile/filesys.c                  |  5 +----
 libguile/fports.c                   |  3 ---
 libguile/gen-scmconfig.c            | 16 +---------------
 libguile/hash.c                     |  3 ---
 libguile/net_db.c                   |  4 ----
 libguile/numbers.h                  | 16 +++++++---------
 libguile/regex-posix.c              |  7 -------
 libguile/scmsigs.c                  |  6 +-----
 libguile/socket.c                   |  3 +--
 test-suite/standalone/test-unwind.c |  6 +-----
 12 files changed, 21 insertions(+), 70 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9366cdbc2..133b5028e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -418,10 +418,10 @@ AC_SUBST([SCM_I_GSC_HAVE_STRUCT_DIRENT64])
 #   sched.h - missing on MinGW
 #   sys/sendfile.h - non-POSIX, found in glibc
 #
-AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h limits.h memory.h process.h 
string.h \
+AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h memory.h process.h \
 sys/dir.h sys/ioctl.h sys/select.h \
 sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
-sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
+sys/utime.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
 direct.h machine/fpu.h sched.h sys/sendfile.h])
 
 # "complex double" is new in C99, and "complex" is only a keyword if
@@ -489,7 +489,7 @@ AM_CONDITIONAL([MINGW_LIBPATH], [test x$mingw_libpath = 
xtrue])
 # Reasons for testing:
 #   crt_externs.h - Darwin specific
 #
-AC_CHECK_HEADERS([assert.h crt_externs.h])
+AC_CHECK_HEADERS([crt_externs.h])
 
 # Reasons for testing:
 #   DINFINITY - OSF specific
@@ -902,9 +902,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 ()
 {
@@ -1006,7 +1004,9 @@ int main () { return (isnan(x) != 0); }]])],
 #
 AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blksize, struct 
stat.st_blocks, struct stat.st_atim, struct stat.st_mtim, struct 
stat.st_ctim],,,
                  [#define _GNU_SOURCE
-AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
 ])
 
 AC_STRUCT_TIMEZONE
@@ -1053,8 +1053,7 @@ GUILE_UNISTRING_ICONVEH_VALUES
 
 SCM_I_GSC_STACK_GROWS_UP=0
 AC_RUN_IFELSE([AC_LANG_SOURCE(
-[AC_INCLUDES_DEFAULT
-int
+[int
 find_stack_direction (int *addr, int depth)
 {
   int dir, dummy = 0;
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c
index f42fbb427..bbc23f449 100644
--- a/libguile/bytevectors.c
+++ b/libguile/bytevectors.c
@@ -22,10 +22,7 @@
 # include <config.h>
 #endif
 
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
+#include <limits.h>
 #include <byteswap.h>
 #include <errno.h>
 #include <striconveh.h>
diff --git a/libguile/filesys.c b/libguile/filesys.c
index 6247734e8..f182f6c79 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -43,6 +43,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <string.h>
 
 #ifdef HAVE_DIRECT_H
 #include <direct.h>
@@ -67,10 +68,6 @@
 #include <libc.h>
 #endif
 
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
 #ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
diff --git a/libguile/fports.c b/libguile/fports.c
index 121d50bf0..9d4ca6ace 100644
--- a/libguile/fports.c
+++ b/libguile/fports.c
@@ -28,10 +28,7 @@
 
 #include <stdio.h>
 #include <fcntl.h>
-
-#ifdef HAVE_STRING_H
 #include <string.h>
-#endif
 #include <unistd.h>
 #ifdef HAVE_IO_H
 #include <io.h>
diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c
index 691ebd0af..4525455b6 100644
--- a/libguile/gen-scmconfig.c
+++ b/libguile/gen-scmconfig.c
@@ -159,12 +159,7 @@ main (int argc, char *argv[])
   pf ("/* Important headers */\n");
   pf ("#include <stdint.h>\n");
   pf ("#include <stddef.h>\n");
-
-#ifdef HAVE_LIMITS_H
   pf ("#include <limits.h>\n");
-#else
-  pf ("/* limits.h not available */\n");
-#endif
 
 #if HAVE_SYS_TIME_H
   pf ("#include <sys/time.h>\n");
@@ -172,15 +167,9 @@ main (int argc, char *argv[])
   pf ("/* sys/time.h not available */\n");
 #endif
 
-#if HAVE_TIME_H
   pf ("#include <time.h>\n");
-#else
-  pf ("/* time.h not available */\n");
-#endif
-
   pf("\n");
-#ifdef STDC_HEADERS
-  pf ("#define SCM_HAVE_STDC_HEADERS 1 /* 0 or 1 */\n");
+
   pf ("#include <stdlib.h>\n");
 # ifdef HAVE_SYS_TYPES_H
   pf ("#include <sys/types.h>\n");
@@ -189,9 +178,6 @@ main (int argc, char *argv[])
   pf ("#include <sys/stdtypes.h>\n");
 # 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/hash.c b/libguile/hash.c
index 11a35c2cb..c192ac2e5 100644
--- a/libguile/hash.c
+++ b/libguile/hash.c
@@ -24,10 +24,7 @@
 # include <config.h>
 #endif
 
-#ifdef HAVE_WCHAR_H
 #include <wchar.h>
-#endif
-
 #include <math.h>
 #include <string.h>
 #include <unistr.h>
diff --git a/libguile/net_db.c b/libguile/net_db.c
index dfb61e8d0..81e701668 100644
--- a/libguile/net_db.c
+++ b/libguile/net_db.c
@@ -33,11 +33,7 @@
 
 #include <verify.h>
 #include <errno.h>
-
-#ifdef HAVE_STRING_H
 #include <string.h>
-#endif
-
 #include <sys/types.h>
 
 #include <sys/socket.h>
diff --git a/libguile/numbers.h b/libguile/numbers.h
index fdb446e1a..84ad5466f 100644
--- a/libguile/numbers.h
+++ b/libguile/numbers.h
@@ -112,15 +112,13 @@ typedef long scm_t_inum;
  * SCM_FLTMAX is less than or scm_equal the largest single precision float
  */
 
-#if SCM_HAVE_STDC_HEADERS
-# ifndef GO32
-#  include <float.h>
-#  ifdef __MINGW32__
-#   define copysign _copysign
-#   define finite _finite
-#  endif /* __MINGW32__ */
-# endif /* ndef GO32 */
-#endif /* def STDC_HEADERS */
+#ifndef GO32
+# include <float.h>
+# ifdef __MINGW32__
+#  define copysign _copysign
+#  define finite _finite
+# endif /* __MINGW32__ */
+#endif /* ndef GO32 */
 
 #ifdef DBL_MAX_10_EXP
 # define SCM_MAXEXP DBL_MAX_10_EXP
diff --git a/libguile/regex-posix.c b/libguile/regex-posix.c
index a08da02db..5eb05c07c 100644
--- a/libguile/regex-posix.c
+++ b/libguile/regex-posix.c
@@ -35,10 +35,7 @@
 #include <regex.h>
 #include <string.h>
 #include <sys/types.h>
-
-#ifdef HAVE_WCHAR_H
 #include <wchar.h>
-#endif
 
 #include "async.h"
 #include "feature.h"
@@ -187,7 +184,6 @@ SCM_DEFINE (scm_make_regexp, "make-regexp", 1, 0, 1,
 }
 #undef FUNC_NAME
 
-#ifdef HAVE_WCHAR_H
 /*
  * While regexec does respect the current locale, it returns byte
  * offsets instead of character offsets. This routine fixes up the
@@ -222,7 +218,6 @@ fixup_multibyte_match (regmatch_t *matches, int nmatches, 
char *str)
     }
 
 }
-#endif
 
 SCM_DEFINE (scm_regexp_exec, "regexp-exec", 2, 2, 0,
             (SCM rx, SCM str, SCM start, SCM flags),
@@ -280,10 +275,8 @@ SCM_DEFINE (scm_regexp_exec, "regexp-exec", 2, 2, 0,
   status = regexec (SCM_RGX (rx), c_str, nmatches, matches,
                    scm_to_int (flags));
 
-#ifdef HAVE_WCHAR_H
   if (!status)
     fixup_multibyte_match (matches, nmatches, c_str);
-#endif
 
   free (c_str);
 
diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index d1daf04b4..5b8ffaf80 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -67,11 +67,7 @@
 #ifdef RETSIGTYPE
 # define SIGRETTYPE RETSIGTYPE
 #else
-# ifdef STDC_HEADERS
-#  define SIGRETTYPE void
-# else
-#  define SIGRETTYPE int
-# endif
+# define SIGRETTYPE void
 #endif
 
 
diff --git a/libguile/socket.c b/libguile/socket.c
index b3482c8f3..5d77bf94e 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -30,9 +30,8 @@
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
-#ifdef HAVE_STRING_H
+
 #include <string.h>
-#endif
 #include <unistd.h>
 #include <sys/types.h>
 
diff --git a/test-suite/standalone/test-unwind.c 
b/test-suite/standalone/test-unwind.c
index 33752cd22..48096732d 100644
--- a/test-suite/standalone/test-unwind.c
+++ b/test-suite/standalone/test-unwind.c
@@ -27,11 +27,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-
+#include <string.h>
 
 void set_flag (void *data);
 void func1 (void);



reply via email to

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