mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
* tags.h (SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
SCM_T_SIGNED_BITS_MIN): New. * numbers.h (SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM): Use them to make these macros computable by the preprocessor.
This commit is contained in:
parent
152812c057
commit
004c0902ff
2 changed files with 9 additions and 7 deletions
|
@ -55,13 +55,9 @@
|
|||
*
|
||||
* 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)
|
||||
|
|
|
@ -65,9 +65,15 @@
|
|||
#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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue