guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 01/26: Start to use C99 stdint in gen-scmconfig


From: Andy Wingo
Subject: [Guile-commits] 01/26: Start to use C99 stdint in gen-scmconfig
Date: Tue, 26 Jun 2018 11:26:09 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 5e5afde06fd9dd0992294d6c7dc9f9966c0caa37
Author: Andy Wingo <address@hidden>
Date:   Thu Jun 21 07:58:54 2018 +0200

    Start to use C99 stdint in gen-scmconfig
    
    * configure.ac: Remove checks for stdint.h; we require C99 so it must be
      there; and in any case for our purposes we use gnulib, so it will be
      there.  No need to check for inttypes.h.  No need to check for what
      type maps to e.g. uint32_t either.
    * libguile/deprecated.h (SCM_HAVE_T_INT64, SCM_HAVE_T_UINT64): Deprecate
      these, as they are always 1.
      (SCM_HAVE_ARRAYS): Likewise deprecate; it's always 1.
    * libguile/gen-scmconfig.c: Always include stdint.h and stddef.h, and
      make it so that scmconfig.h also includes these.  Use C99 types.
    * libguile/gen-scmconfig.h.in: Remove configure-substed vars that are no
      longer defined.
---
 configure.ac                | 305 --------------------------------------------
 libguile/deprecated.h       |   5 +
 libguile/gen-scmconfig.c    |  99 +++++---------
 libguile/gen-scmconfig.h.in |  15 ---
 4 files changed, 38 insertions(+), 386 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9f80cc4..082a621 100644
--- a/configure.ac
+++ b/configure.ac
@@ -321,313 +321,8 @@ else
 fi
 AC_SUBST([SCM_I_GSC_T_PTRDIFF])
 
-AC_CHECK_HEADERS([stdint.h])
-AC_CHECK_HEADERS([inttypes.h])
 AC_CHECK_HEADERS([stdatomic.h])
 
-AC_CHECK_SIZEOF(intmax_t)
-
-SCM_I_GSC_NEEDS_STDINT_H=0
-SCM_I_GSC_NEEDS_INTTYPES_H=0
-
-### intptr and uintptr (try not to use inttypes if we don't have to)
-if test "$ac_cv_header_inttypes_h" = yes; then
-  if test "$ac_cv_sizeof_intptr_t" -eq 0; then
-    AC_CHECK_SIZEOF([intptr_t],,[#include <inttypes.h>
-#include <stdio.h>])
-    if test "$ac_cv_sizeof_intptr_t" -ne 0; then
-      SCM_I_GSC_NEEDS_INTTYPES_H=1
-    fi
-  fi
-  if test "$ac_cv_sizeof_uintptr_t" -eq 0; then
-    AC_CHECK_SIZEOF([uintptr_t],,[#include <inttypes.h>
-#include <stdio.h>])
-    if test "$ac_cv_sizeof_uintptr_t" -ne 0; then
-      SCM_I_GSC_NEEDS_INTTYPES_H=1
-    fi
-  fi
-fi
-
-### See what's provided by stdint.h
-if test "$ac_cv_header_stdint_h" = yes; then
-   AC_CHECK_TYPE([int8_t],[scm_stdint_has_int8=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([uint8_t],[scm_stdint_has_uint8=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([int16_t],[scm_stdint_has_int16=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([uint16_t],[scm_stdint_has_uint16=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([int32_t],[scm_stdint_has_int32=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([uint32_t],[scm_stdint_has_uint32=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([int64_t],[scm_stdint_has_int64=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([uint64_t],[scm_stdint_has_uint64=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([intmax_t],[scm_stdint_has_intmax=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([uintmax_t],[scm_stdint_has_uintmax=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([intptr_t],[scm_stdint_has_intptr=1],,[#include <stdint.h>])
-   AC_CHECK_TYPE([uintptr_t],[scm_stdint_has_uintptr=1],,[#include <stdint.h>])
-fi
-
-# so we don't get confused by the cache (wish there was a better way
-# to check particular headers for the same type...)
-
-unset ac_cv_type_int8_t
-unset ac_cv_type_uint8_t
-unset ac_cv_type_int16_t
-unset ac_cv_type_uint16_t
-unset ac_cv_type_int32_t
-unset ac_cv_type_uint32_t
-unset ac_cv_type_int64_t
-unset ac_cv_type_uint64_t
-unset ac_cv_type_intmax_t
-unset ac_cv_type_uintmax_t
-
-### See what's provided by inttypes.h
-if test "$ac_cv_header_inttypes_h" = yes; then
-  AC_CHECK_TYPE([int8_t],[scm_inttypes_has_int8=1],,[#include <inttypes.h>])
-  AC_CHECK_TYPE([uint8_t],[scm_inttypes_has_uint8=1],,[#include <inttypes.h>])
-  AC_CHECK_TYPE([int16_t],[scm_inttypes_has_int16=1],,[#include <inttypes.h>])
-  AC_CHECK_TYPE([uint16_t],[scm_inttypes_has_uint16=1],,[#include 
<inttypes.h>])
-  AC_CHECK_TYPE([int32_t],[scm_inttypes_has_int32=1],,[#include <inttypes.h>])
-  AC_CHECK_TYPE([uint32_t],[scm_inttypes_has_uint32=1],,[#include 
<inttypes.h>])
-  AC_CHECK_TYPE([int64_t],[scm_inttypes_has_int64=1],,[#include <inttypes.h>])
-  AC_CHECK_TYPE([uint64_t],[scm_inttypes_has_uint64=1],,[#include 
<inttypes.h>])
-  AC_CHECK_TYPE([intmax_t],[scm_inttypes_has_intmax=1],,[#include 
<inttypes.h>])
-  AC_CHECK_TYPE([uintmax_t],[scm_inttypes_has_uintmax=1],,[#include 
<inttypes.h>])
-  AC_CHECK_TYPE([intptr_t],[scm_inttypes_has_intptr=1],,[#include 
<inttypes.h>])
-  AC_CHECK_TYPE([uintptr_t],[scm_inttypes_has_uintptr=1],,[#include 
<inttypes.h>])
-fi
-
-# Try hard to find definitions for some required scm_t_*int* types.
-
-### Required type scm_t_int8
-if test "$scm_stdint_has_int8"; then
-  SCM_I_GSC_T_INT8='"int8_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_int8"; then
-  SCM_I_GSC_T_INT8='"int8_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_char" -eq 1; then
-  SCM_I_GSC_T_INT8='"signed char"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for scm_t_int8.])
-fi
-AC_SUBST([SCM_I_GSC_T_INT8])
-
-### Required type scm_t_uint8
-if test "$scm_stdint_has_uint8"; then
-  SCM_I_GSC_T_UINT8='"uint8_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_uint8"; then
-  SCM_I_GSC_T_UINT8='"uint8_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_unsigned_char" -eq 1; then
-  SCM_I_GSC_T_UINT8='"unsigned char"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for scm_t_uint8.])
-fi
-AC_SUBST([SCM_I_GSC_T_UINT8])
-
-### Required type scm_t_int16 (ANSI C says int or short might work)
-if test "$scm_stdint_has_int16"; then
-  SCM_I_GSC_T_INT16='"int16_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_int16"; then
-  SCM_I_GSC_T_INT16='"int16_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_int" -eq 2; then
-  SCM_I_GSC_T_INT16='"int"'
-elif test "$ac_cv_sizeof_short" -eq 2; then
-  SCM_I_GSC_T_INT16='"short"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for scm_t_int16.])
-fi
-AC_SUBST([SCM_I_GSC_T_INT16])
-
-### Required type scm_t_uint16 (ANSI C says int or short might work)
-if test "$scm_stdint_has_uint16"; then
-  SCM_I_GSC_T_UINT16='"uint16_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_uint16"; then
-  SCM_I_GSC_T_UINT16='"uint16_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_unsigned_int" -eq 2; then
-  SCM_I_GSC_T_UINT16='"unsigned int"'
-elif test "$ac_cv_sizeof_unsigned_short" -eq 2; then
-  SCM_I_GSC_T_UINT16='"unsigned short"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for scm_t_uint16.])
-fi
-AC_SUBST([SCM_I_GSC_T_UINT16])
-
-
-### Required type scm_t_int32 (ANSI C says int, short, or long might work)
-if test "$scm_stdint_has_int32"; then
-  SCM_I_GSC_T_INT32='"int32_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_int32"; then
-  SCM_I_GSC_T_INT32='"int32_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_int" -eq 4; then
-  SCM_I_GSC_T_INT32='"int"'
-elif test "$ac_cv_sizeof_long" -eq 4; then
-  SCM_I_GSC_T_INT32='"long"'
-elif test "$ac_cv_sizeof_short" -eq 4; then
-  SCM_I_GSC_T_INT32='"short"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for scm_t_int32.])
-fi
-AC_SUBST([SCM_I_GSC_T_INT32])
-
-### Required type scm_t_uint32 (ANSI C says int, short, or long might work)
-if test "$scm_stdint_has_uint32"; then
-  SCM_I_GSC_T_UINT32='"uint32_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_uint32"; then
-  SCM_I_GSC_T_UINT32='"uint32_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_unsigned_int" -eq 4; then
-  SCM_I_GSC_T_UINT32='"unsigned int"'
-elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then
-  SCM_I_GSC_T_UINT32='"unsigned long"'
-elif test "$ac_cv_sizeof_unsigned_short" -eq 4; then
-  SCM_I_GSC_T_UINT32='"unsigned short"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for scm_t_uint32.])
-fi
-AC_SUBST([SCM_I_GSC_T_UINT32])
-
-### Optional type scm_t_int64 (ANSI C says int, short, or long might work)
-### Also try 'long long' and '__int64' if we have it.
-SCM_I_GSC_T_INT64=0
-if test "$scm_stdint_has_int64"; then
-  SCM_I_GSC_T_INT64='"int64_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_int64"; then
-  SCM_I_GSC_T_INT64='"int64_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_int" -eq 8; then
-  SCM_I_GSC_T_INT64='"int"'
-elif test "$ac_cv_sizeof_long" -eq 8; then
-  SCM_I_GSC_T_INT64='"long"'
-elif test "$ac_cv_sizeof_short" -eq 8; then
-  SCM_I_GSC_T_INT64='"short"'
-elif test "$ac_cv_sizeof_long_long" -eq 8; then
-  SCM_I_GSC_T_INT64='"long long"'
-elif test "$ac_cv_sizeof___int64" -eq 8; then
-  SCM_I_GSC_T_INT64='"__int64"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for scm_t_int64.])
-fi
-AC_SUBST([SCM_I_GSC_T_INT64])
-
-
-### Optional type scm_t_uint64 (ANSI C says int, short, or long might work)
-### Also try 'long long' and '__int64' if we have it.
-SCM_I_GSC_T_UINT64=0
-if test "$scm_stdint_has_uint64"; then
-  SCM_I_GSC_T_UINT64='"uint64_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_uint64"; then
-  SCM_I_GSC_T_UINT64='"uint64_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_unsigned_int" -eq 8; then
-  SCM_I_GSC_T_UINT64='"unsigned int"'
-elif test "$ac_cv_sizeof_unsigned_long" -eq 8; then
-  SCM_I_GSC_T_UINT64='"unsigned long"'
-elif test "$ac_cv_sizeof_unsigned_short" -eq 8; then
-  SCM_I_GSC_T_UINT64='"unsigned short"'
-elif test "$ac_cv_sizeof_unsigned_long_long" -eq 8; then
-  SCM_I_GSC_T_UINT64='"unsigned long long"'
-elif test "$ac_cv_sizeof_unsigned___int64" -eq 8; then
-  SCM_I_GSC_T_UINT64='"unsigned __int64"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for scm_t_uint64.])
-fi
-AC_SUBST([SCM_I_GSC_T_UINT64])
-
-### Required type scm_t_intmax
-###
-### We try 'intmax_t', '__int64', 'long long' in this order.  When
-### none of them is available, we use 'long'.
-###
-SCM_I_GSC_T_INTMAX=0
-if test "$scm_stdint_has_intmax"; then
-  SCM_I_GSC_T_INTMAX='"intmax_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_intmax"; then
-  SCM_I_GSC_T_INTMAX='"intmax_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof___int64" -ne 0; then
-  SCM_I_GSC_T_INTMAX='"__int64"'
-elif test "$ac_cv_sizeof_long_long" -ne 0; then
-  SCM_I_GSC_T_INTMAX='"long long"'
-else
-  SCM_I_GSC_T_INTMAX='"long"'
-fi
-AC_SUBST([SCM_I_GSC_T_INTMAX])
-
-### Required type scm_t_uintmax
-###
-### We try 'uintmax_t', 'unsigned __int64', 'unsigned long long' in
-### this order.  When none of them is available, we use 'unsigned long'.
-###
-SCM_I_GSC_T_UINTMAX=0
-if test "$scm_stdint_has_uintmax"; then
-  SCM_I_GSC_T_UINTMAX='"uintmax_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_uintmax"; then
-  SCM_I_GSC_T_UINTMAX='"uintmax_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_unsigned___int64" -ne 0; then
-  SCM_I_GSC_T_UINTMAX='"unsigned __int64"'
-elif test "$ac_cv_sizeof_unsigned_long_long" -ne 0; then
-  SCM_I_GSC_T_UINTMAX='"unsigned long long"'
-else
-  SCM_I_GSC_T_UINTMAX='"unsigned long"'
-fi
-AC_SUBST([SCM_I_GSC_T_UINTMAX])
-
-### Required type scm_t_intptr
-###
-SCM_I_GSC_T_INTPTR=0
-if test "$scm_stdint_has_intptr"; then
-  SCM_I_GSC_T_INTPTR='"intptr_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_intptr"; then
-  SCM_I_GSC_T_INTPTR='"intptr_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_void_p"; then
-  SCM_I_GSC_T_INTPTR='"int"'
-elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_void_p"; then
-  SCM_I_GSC_T_INTPTR='"long"'
-elif test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_void_p"; then
-  SCM_I_GSC_T_INTPTR='"long long"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for `scm_t_intptr'.])
-fi
-AC_SUBST([SCM_I_GSC_T_INTPTR])
-
-### Required type scm_t_uintptr
-###
-SCM_I_GSC_T_UINTPTR=0
-if test "$scm_stdint_has_uintptr"; then
-  SCM_I_GSC_T_UINTPTR='"uintptr_t"'
-  SCM_I_GSC_NEEDS_STDINT_H=1
-elif test "$scm_inttypes_has_uintptr"; then
-  SCM_I_GSC_T_UINTPTR='"uintptr_t"'
-  SCM_I_GSC_NEEDS_INTTYPES_H=1
-elif test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_void_p"; then
-  SCM_I_GSC_T_UINTPTR='"unsigned int"'
-elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_void_p"; then
-  SCM_I_GSC_T_UINTPTR='"unsigned long"'
-elif test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_void_p"; then
-  SCM_I_GSC_T_UINTPTR='"unsigned long long"'
-else
-  AC_MSG_ERROR([Can't find appropriate type for `scm_t_uintptr'.])
-fi
-AC_SUBST([SCM_I_GSC_T_UINTPTR])
-
-
-AC_SUBST([SCM_I_GSC_NEEDS_STDINT_H])
-AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H])
-
 AC_MSG_CHECKING([for which prebuilt binary set to use during bootstrap])
 SCM_PREBUILT_BINARIES=
 case "$ac_cv_c_bigendian-$ac_cv_sizeof_void_p" in
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index 1dace99..9552d0e 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -84,6 +84,11 @@
 #define SCM_T_INTPTR_MIN  INTPTR_MIN
 #define SCM_T_INTPTR_MAX  INTPTR_MAX
 
+#define SCM_HAVE_T_INT64 1 /* 0 or 1 */
+#define SCM_HAVE_T_UINT64 1 /* 0 or 1 */
+
+#define SCM_HAVE_ARRAYS 1 /* always true now */
+
 void scm_i_init_deprecated (void);
 
 #endif
diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c
index 92443a9..8091cc6 100644
--- a/libguile/gen-scmconfig.c
+++ b/libguile/gen-scmconfig.c
@@ -136,6 +136,8 @@
 #  include <config.h>
 #endif
 
+#include <stdint.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -155,10 +157,8 @@ main (int argc, char *argv[])
   /*** various important headers ***/
   pf ("\n");
   pf ("/* Important headers */\n");
-  if (SCM_I_GSC_NEEDS_STDINT_H)
-    pf ("#include <stdint.h>\n");
-  if (SCM_I_GSC_NEEDS_INTTYPES_H)
-    pf ("#include <inttypes.h>\n");
+  pf ("#include <stdint.h>\n");
+  pf ("#include <stddef.h>\n");
 
 #ifdef HAVE_LIMITS_H
   pf ("#include <limits.h>\n");
@@ -239,65 +239,35 @@ main (int argc, char *argv[])
   pf ("\n");
   pf ("/* Standard types. */\n");
 
-  pf ("/* These are always defined */\n");  
-  pf ("#define SCM_SIZEOF_CHAR %d\n", SIZEOF_CHAR);
-  pf ("#define SCM_SIZEOF_UNSIGNED_CHAR %d\n", SIZEOF_UNSIGNED_CHAR);
-  pf ("#define SCM_SIZEOF_SHORT %d\n", SIZEOF_SHORT);
-  pf ("#define SCM_SIZEOF_UNSIGNED_SHORT %d\n", SIZEOF_UNSIGNED_SHORT);
-  pf ("#define SCM_SIZEOF_LONG %d\n", SIZEOF_LONG);
-  pf ("#define SCM_SIZEOF_UNSIGNED_LONG %d\n", SIZEOF_UNSIGNED_LONG);
-  pf ("#define SCM_SIZEOF_INT %d\n", SIZEOF_INT);
-  pf ("#define SCM_SIZEOF_UNSIGNED_INT %d\n", SIZEOF_UNSIGNED_INT);
-  pf ("#define SCM_SIZEOF_SIZE_T %d\n", SIZEOF_SIZE_T);
-
-  pf ("\n");
-  pf ("/* Size of (unsigned) long long or 0 if not available (scm_t_*64 may\n"
-      "   be more likely to be what you want */\n");
-  pf ("#define SCM_SIZEOF_LONG_LONG %d\n", SIZEOF_LONG_LONG);
-  pf ("#define SCM_SIZEOF_UNSIGNED_LONG_LONG %d\n", SIZEOF_UNSIGNED_LONG_LONG);
-
-  pf ("\n");
-  pf ("/* These are always defined. */\n");
-  pf ("typedef %s scm_t_int8;\n", SCM_I_GSC_T_INT8);
-  pf ("typedef %s scm_t_uint8;\n", SCM_I_GSC_T_UINT8);
-  pf ("typedef %s scm_t_int16;\n", SCM_I_GSC_T_INT16);
-  pf ("typedef %s scm_t_uint16;\n", SCM_I_GSC_T_UINT16);
-  pf ("typedef %s scm_t_int32;\n", SCM_I_GSC_T_INT32);
-  pf ("typedef %s scm_t_uint32;\n", SCM_I_GSC_T_UINT32);
-  pf ("typedef %s scm_t_intmax;\n", SCM_I_GSC_T_INTMAX);
-  pf ("typedef %s scm_t_uintmax;\n", SCM_I_GSC_T_UINTMAX);
-  pf ("typedef %s scm_t_intptr;\n", SCM_I_GSC_T_INTPTR);
-  pf ("typedef %s scm_t_uintptr;\n", SCM_I_GSC_T_UINTPTR);
-
-  if (0 == strcmp ("intmax_t", SCM_I_GSC_T_INTMAX))
-    pf ("#define SCM_SIZEOF_INTMAX %d\n", SIZEOF_INTMAX_T);
-  else if (0 == strcmp ("long long", SCM_I_GSC_T_INTMAX))
-    pf ("#define SCM_SIZEOF_INTMAX %d\n", SIZEOF_LONG_LONG);
-  else if (0 == strcmp ("__int64", SCM_I_GSC_T_INTMAX))
-    pf ("#define SCM_SIZEOF_INTMAX %d\n", SIZEOF___INT64);
-  else
-    return 1;
-
-  pf ("\n");
-  pf ("#define SCM_HAVE_T_INT64 1 /* 0 or 1 */\n");
-  pf ("typedef %s scm_t_int64;\n", SCM_I_GSC_T_INT64);
-  pf ("#define SCM_HAVE_T_UINT64 1 /* 0 or 1 */\n");
-  pf ("typedef %s scm_t_uint64;\n", SCM_I_GSC_T_UINT64);
-
-  pf ("\n");
-  pf ("/* scm_t_ptrdiff and size, always defined -- defined to long if\n"
-      "   platform doesn't have ptrdiff_t. */\n");
-  pf ("typedef %s scm_t_ptrdiff;\n", SCM_I_GSC_T_PTRDIFF);
-  if (0 == strcmp ("long", SCM_I_GSC_T_PTRDIFF))
-    pf ("#define SCM_SIZEOF_SCM_T_PTRDIFF %d\n", SIZEOF_LONG);
-  else
-    pf ("#define SCM_SIZEOF_SCM_T_PTRDIFF %d\n", SIZEOF_PTRDIFF_T);
-
-  pf ("\n");
-  pf ("/* Size of intptr_t or 0 if not available */\n");
-  pf ("#define SCM_SIZEOF_INTPTR_T %d\n", SIZEOF_INTPTR_T);
-  pf ("/* Size of uintptr_t or 0 if not available */\n");
-  pf ("#define SCM_SIZEOF_UINTPTR_T %d\n", SIZEOF_UINTPTR_T);
+  pf ("#define SCM_SIZEOF_CHAR %zu\n", sizeof (char));
+  pf ("#define SCM_SIZEOF_UNSIGNED_CHAR %zu\n", sizeof (unsigned char));
+  pf ("#define SCM_SIZEOF_SHORT %zu\n", sizeof (short));
+  pf ("#define SCM_SIZEOF_UNSIGNED_SHORT %zu\n", sizeof (unsigned short));
+  pf ("#define SCM_SIZEOF_LONG %zu\n", sizeof (long));
+  pf ("#define SCM_SIZEOF_UNSIGNED_LONG %zu\n", sizeof (unsigned long));
+  pf ("#define SCM_SIZEOF_INT %zu\n", sizeof (int));
+  pf ("#define SCM_SIZEOF_UNSIGNED_INT %zu\n", sizeof (unsigned int));
+  pf ("#define SCM_SIZEOF_SIZE_T %zu\n", sizeof (size_t));
+  pf ("#define SCM_SIZEOF_LONG_LONG %zu\n", sizeof (long long));
+  pf ("#define SCM_SIZEOF_UNSIGNED_LONG_LONG %zu\n", sizeof (unsigned long 
long));
+  pf ("#define SCM_SIZEOF_INTMAX %zu\n", sizeof (intmax_t));
+  pf ("#define SCM_SIZEOF_SCM_T_PTRDIFF %zu\n", sizeof (ptrdiff_t));
+  pf ("#define SCM_SIZEOF_INTPTR_T %zu\n", sizeof (intptr_t));
+  pf ("#define SCM_SIZEOF_UINTPTR_T %zu\n", sizeof (uintptr_t));
+
+  pf("typedef int8_t scm_t_int8;\n");
+  pf("typedef uint8_t scm_t_uint8;\n");
+  pf("typedef int16_t scm_t_int16;\n");
+  pf("typedef uint16_t scm_t_uint16;\n");
+  pf("typedef int32_t scm_t_int32;\n");
+  pf("typedef uint32_t scm_t_uint32;\n");
+  pf("typedef intmax_t scm_t_intmax;\n");
+  pf("typedef uintmax_t scm_t_uintmax;\n");
+  pf("typedef intptr_t scm_t_intptr;\n");
+  pf("typedef uintptr_t scm_t_uintptr;\n");
+  pf("typedef int64_t scm_t_int64;\n");
+  pf("typedef uint64_t scm_t_uint64;\n");
+  pf("typedef ptrdiff_t scm_t_ptrdiff;\n");
 
   pf ("\n");
   pf ("/* same as POSIX \"struct timespec\" -- always defined */\n");
@@ -405,9 +375,6 @@ main (int argc, char *argv[])
 #endif
 
   pf ("\n");
-  pf ("#define SCM_HAVE_ARRAYS 1 /* always true now */\n");
-
-  pf ("\n");
   pf ("/* Constants from uniconv.h.  */\n");
   pf ("#define SCM_ICONVEH_ERROR %d\n", SCM_I_GSC_ICONVEH_ERROR);
   pf ("#define SCM_ICONVEH_QUESTION_MARK %d\n",
diff --git a/libguile/gen-scmconfig.h.in b/libguile/gen-scmconfig.h.in
index 7b6407d..6e5ebdb 100644
--- a/libguile/gen-scmconfig.h.in
+++ b/libguile/gen-scmconfig.h.in
@@ -10,21 +10,6 @@
 #define SCM_I_GSC_ENABLE_DEPRECATED @SCM_I_GSC_ENABLE_DEPRECATED@
 #define SCM_I_GSC_STACK_GROWS_UP @SCM_I_GSC_STACK_GROWS_UP@
 #define SCM_I_GSC_C_INLINE @SCM_I_GSC_C_INLINE@
-#define SCM_I_GSC_NEEDS_STDINT_H @SCM_I_GSC_NEEDS_STDINT_H@
-#define SCM_I_GSC_NEEDS_INTTYPES_H @SCM_I_GSC_NEEDS_INTTYPES_H@
-#define SCM_I_GSC_T_INT8 @SCM_I_GSC_T_INT8@
-#define SCM_I_GSC_T_UINT8 @SCM_I_GSC_T_UINT8@
-#define SCM_I_GSC_T_INT16 @SCM_I_GSC_T_INT16@
-#define SCM_I_GSC_T_UINT16 @SCM_I_GSC_T_UINT16@
-#define SCM_I_GSC_T_INT32 @SCM_I_GSC_T_INT32@
-#define SCM_I_GSC_T_UINT32 @SCM_I_GSC_T_UINT32@
-#define SCM_I_GSC_T_INT64 @SCM_I_GSC_T_INT64@
-#define SCM_I_GSC_T_UINT64 @SCM_I_GSC_T_UINT64@
-#define SCM_I_GSC_T_INTMAX @SCM_I_GSC_T_INTMAX@
-#define SCM_I_GSC_T_UINTMAX @SCM_I_GSC_T_UINTMAX@
-#define SCM_I_GSC_T_INTPTR @SCM_I_GSC_T_INTPTR@
-#define SCM_I_GSC_T_UINTPTR @SCM_I_GSC_T_UINTPTR@
-#define SCM_I_GSC_T_PTRDIFF @SCM_I_GSC_T_PTRDIFF@
 #define SCM_I_GSC_USE_PTHREAD_THREADS @SCM_I_GSC_USE_PTHREAD_THREADS@
 #define SCM_I_GSC_USE_NULL_THREADS @SCM_I_GSC_USE_NULL_THREADS@
 #define SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT 
@SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT@



reply via email to

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