summaryrefslogtreecommitdiff
path: root/libguile/__scm.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-06-20 14:55:49 +0200
committerAndy Wingo <wingo@pobox.com>2018-06-20 15:01:13 +0200
commit2eb8fa1751dcb1b57bc607c6df61f9d363dff8c3 (patch)
treeaa58d31922c878effeb919706c1e15beacf3fd01 /libguile/__scm.h
parente605b518ee472d18e3bb3bcfb8840abfa8486372 (diff)
downloadguile-2eb8fa1751dcb1b57bc607c6df61f9d363dff8c3.tar.gz
Use stdint.h limit macros
* libguile/__scm.h: Include <stdint.h>, now that we rely on C99. (SCM_T_UINT8_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT16_MAX) (SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT32_MAX, SCM_T_INT32_MIN) (SCM_T_INT32_MAX, SCM_T_UINT64_MAX, SCM_T_INT64_MIN, SCM_T_INT64_MAX) (SCM_T_UINTMAX_MAX, SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX) (SCM_T_UINTPTR_MAX, SCM_T_INTPTR_MIN, SCM_T_INTPTR_MAX): Define in terms of equivalent stdint.h definitions. * libguile/gen-scmconfig.c: * libguile/instructions.c: * libguile/numbers.c: * libguile/random.c: * libguile/tags.h: * test-suite/standalone/test-conversion.c: Adapt to use C99 names.
Diffstat (limited to 'libguile/__scm.h')
-rw-r--r--libguile/__scm.h38
1 files changed, 20 insertions, 18 deletions
diff --git a/libguile/__scm.h b/libguile/__scm.h
index eae1afb6d..bd81cb092 100644
--- a/libguile/__scm.h
+++ b/libguile/__scm.h
@@ -37,6 +37,8 @@
The main documentation is in gen-scmconfig.c.
**********************************************************************/
+#include <stdint.h>
+
/* What did the configure script discover about the outside world? */
#include "libguile/scmconfig.h"
@@ -289,29 +291,29 @@
#define SCM_I_TYPE_MAX(type,umax) ((type)((umax)/2))
#define SCM_I_TYPE_MIN(type,umax) (-((type)((umax)/2))-1)
-#define SCM_T_UINT8_MAX SCM_I_UTYPE_MAX(scm_t_uint8)
-#define SCM_T_INT8_MIN SCM_I_TYPE_MIN(scm_t_int8,SCM_T_UINT8_MAX)
-#define SCM_T_INT8_MAX SCM_I_TYPE_MAX(scm_t_int8,SCM_T_UINT8_MAX)
+#define SCM_T_UINT8_MAX UINT8_MAX
+#define SCM_T_INT8_MIN INT8_MIN
+#define SCM_T_INT8_MAX INT8_MAX
-#define SCM_T_UINT16_MAX SCM_I_UTYPE_MAX(scm_t_uint16)
-#define SCM_T_INT16_MIN SCM_I_TYPE_MIN(scm_t_int16,SCM_T_UINT16_MAX)
-#define SCM_T_INT16_MAX SCM_I_TYPE_MAX(scm_t_int16,SCM_T_UINT16_MAX)
+#define SCM_T_UINT16_MAX UINT16_MAX
+#define SCM_T_INT16_MIN INT16_MIN
+#define SCM_T_INT16_MAX INT16_MAX
-#define SCM_T_UINT32_MAX SCM_I_UTYPE_MAX(scm_t_uint32)
-#define SCM_T_INT32_MIN SCM_I_TYPE_MIN(scm_t_int32,SCM_T_UINT32_MAX)
-#define SCM_T_INT32_MAX SCM_I_TYPE_MAX(scm_t_int32,SCM_T_UINT32_MAX)
+#define SCM_T_UINT32_MAX UINT32_MAX
+#define SCM_T_INT32_MIN INT32_MIN
+#define SCM_T_INT32_MAX INT32_MAX
-#define SCM_T_UINT64_MAX SCM_I_UTYPE_MAX(scm_t_uint64)
-#define SCM_T_INT64_MIN SCM_I_TYPE_MIN(scm_t_int64,SCM_T_UINT64_MAX)
-#define SCM_T_INT64_MAX SCM_I_TYPE_MAX(scm_t_int64,SCM_T_UINT64_MAX)
+#define SCM_T_UINT64_MAX UINT64_MAX
+#define SCM_T_INT64_MIN INT64_MIN
+#define SCM_T_INT64_MAX INT64_MAX
-#define SCM_T_UINTMAX_MAX SCM_I_UTYPE_MAX(scm_t_uintmax)
-#define SCM_T_INTMAX_MIN SCM_I_TYPE_MIN(scm_t_intmax,SCM_T_UINTMAX_MAX)
-#define SCM_T_INTMAX_MAX SCM_I_TYPE_MAX(scm_t_intmax,SCM_T_UINTMAX_MAX)
+#define SCM_T_UINTMAX_MAX UINTMAX_MAX
+#define SCM_T_INTMAX_MIN INTMAX_MIN
+#define SCM_T_INTMAX_MAX INTMAX_MAX
-#define SCM_T_UINTPTR_MAX SCM_I_UTYPE_MAX(scm_t_uintptr)
-#define SCM_T_INTPTR_MIN SCM_I_TYPE_MIN(scm_t_intptr,SCM_T_UINTPTR_MAX)
-#define SCM_T_INTPTR_MAX SCM_I_TYPE_MAX(scm_t_intptr,SCM_T_UINTPTR_MAX)
+#define SCM_T_UINTPTR_MAX UINTPTR_MAX
+#define SCM_T_INTPTR_MIN INTPTR_MIN
+#define SCM_T_INTPTR_MAX INTPTR_MAX