mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-04 03:00:20 +02:00
Matthias Koeppe <mkoeppe@merkur.math.uni-magdeburg.de>:
(scm_t_bits, scm_t_signed_bits, etc): Avoid solaris empty defines of INTPTR_MAX and UINTPTR_MAX, combine conditionals for scm_t_bits and scm_t_signed_bits to avoid any chance of one and not the other using intptr_t.
This commit is contained in:
parent
005d2366ef
commit
23c96d9b15
1 changed files with 14 additions and 8 deletions
|
@ -39,24 +39,30 @@
|
||||||
|
|
||||||
/* In the beginning was the Word:
|
/* In the beginning was the Word:
|
||||||
*/
|
*/
|
||||||
#if SCM_SIZEOF_INTPTR_T != 0 && defined(INTPTR_MAX) && defined(INTPTR_MIN)
|
/* On Solaris 7 and 8, /usr/include/sys/int_limits.h defines
|
||||||
|
INTPTR_MAX and UINTPTR_MAX to empty, INTPTR_MIN is not defined.
|
||||||
|
To avoid uintptr_t and intptr_t in this case we require
|
||||||
|
UINTPTR_MAX-0 != 0 etc. */
|
||||||
|
#if SCM_SIZEOF_INTPTR_T != 0 && defined(INTPTR_MAX) && defined(INTPTR_MIN) \
|
||||||
|
&& INTPTR_MAX-0 != 0 && INTPTR_MIN-0 != 0 \
|
||||||
|
&& SCM_SIZEOF_UINTPTR_T != 0 && defined(UINTPTR_MAX) && UINTPTR_MAX-0 != 0
|
||||||
|
|
||||||
typedef intptr_t scm_t_signed_bits;
|
typedef intptr_t scm_t_signed_bits;
|
||||||
#define SCM_T_SIGNED_BITS_MAX INTPTR_MAX
|
#define SCM_T_SIGNED_BITS_MAX INTPTR_MAX
|
||||||
#define SCM_T_SIGNED_BITS_MIN INTPTR_MIN
|
#define SCM_T_SIGNED_BITS_MIN INTPTR_MIN
|
||||||
#else
|
|
||||||
typedef signed long scm_t_signed_bits;
|
|
||||||
#define SCM_T_SIGNED_BITS_MAX LONG_MAX
|
|
||||||
#define SCM_T_SIGNED_BITS_MIN LONG_MIN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SCM_SIZEOF_UINTPTR_T != 0 && defined(UINTPTR_MAX)
|
|
||||||
typedef uintptr_t scm_t_bits;
|
typedef uintptr_t scm_t_bits;
|
||||||
#define SIZEOF_SCM_T_BITS SCM_SIZEOF_UINTPTR_T
|
#define SIZEOF_SCM_T_BITS SCM_SIZEOF_UINTPTR_T
|
||||||
#define SCM_T_BITS_MAX UINTPTR_MAX
|
#define SCM_T_BITS_MAX UINTPTR_MAX
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
typedef signed long scm_t_signed_bits;
|
||||||
|
#define SCM_T_SIGNED_BITS_MAX LONG_MAX
|
||||||
|
#define SCM_T_SIGNED_BITS_MIN LONG_MIN
|
||||||
typedef unsigned long scm_t_bits;
|
typedef unsigned long scm_t_bits;
|
||||||
#define SIZEOF_SCM_T_BITS SCM_SIZEOF_UNSIGNED_LONG
|
#define SIZEOF_SCM_T_BITS SCM_SIZEOF_UNSIGNED_LONG
|
||||||
#define SCM_T_BITS_MAX ULONG_MAX
|
#define SCM_T_BITS_MAX ULONG_MAX
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* But as external interface, we use SCM, which may, according to the desired
|
/* But as external interface, we use SCM, which may, according to the desired
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue