*
* Inums are exact integer data that fits within an SCM word. */
-#define SCM_I_FIXNUM_BIT \
- (SCM_LONG_BIT - 2)
-#define SCM_MOST_POSITIVE_FIXNUM \
- ((((scm_t_signed_bits) 1) << (SCM_I_FIXNUM_BIT - 1)) - 1)
-#define SCM_MOST_NEGATIVE_FIXNUM \
- (-((scm_t_signed_bits) SCM_MOST_POSITIVE_FIXNUM) - 1)
-
+#define SCM_I_FIXNUM_BIT (SCM_LONG_BIT - 2)
+#define SCM_MOST_POSITIVE_FIXNUM (SCM_T_SIGNED_BITS_MAX/8-1)
+#define SCM_MOST_NEGATIVE_FIXNUM (-SCM_MOST_POSITIVE_FIXNUM-1)
/* SCM_SRS is signed right shift */
#if (-1 == (((-1) << 2) + 2) >> 2)
#ifdef HAVE_UINTPTR_T
typedef uintptr_t scm_t_bits;
typedef intptr_t scm_t_signed_bits;
+#define SCM_T_BITS_MAX UINTPTR_MAX
+#define SCM_T_SIGNED_BITS_MAX INTPTR_MAX
+#define SCM_T_SIGNED_BITS_MIN INTPTR_MIN
#else
typedef unsigned long scm_t_bits;
typedef signed long scm_t_signed_bits;
+#define SCM_T_BITS_MAX ULONG_MAX
+#define SCM_T_SIGNED_BITS_MAX LONG_MAX
+#define SCM_T_SIGNED_BITS_MIN LONG_MIN
#endif
/* But as external interface, we use SCM, which may, according to the desired