diff --git a/libguile/_scm.h b/libguile/_scm.h index 87ae34bd3..ce43502d7 100644 --- a/libguile/_scm.h +++ b/libguile/_scm.h @@ -36,9 +36,6 @@ # include #endif -/* The size of `scm_t_bits'. */ -#define SIZEOF_SCM_T_BITS SIZEOF_VOID_P - #include #include #include diff --git a/libguile/conv-integer.i.c b/libguile/conv-integer.i.c index 0aa81dc74..2a020b316 100644 --- a/libguile/conv-integer.i.c +++ b/libguile/conv-integer.i.c @@ -29,7 +29,7 @@ SCM_TO_TYPE_PROTO (SCM val) if (SCM_I_INUMP (val)) { scm_t_signed_bits n = SCM_I_INUM (val); -#if SIZEOF_TYPE != 0 && SIZEOF_TYPE > SIZEOF_SCM_T_BITS +#if SIZEOF_TYPE != 0 && SIZEOF_TYPE > SIZEOF_UINTPTR_T return n; #else if (n >= TYPE_MIN && n <= TYPE_MAX) @@ -113,7 +113,7 @@ SCM_TO_TYPE_PROTO (SCM val) SCM SCM_FROM_TYPE_PROTO (TYPE val) { -#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_SCM_T_BITS +#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_UINTPTR_T return SCM_I_MAKINUM (val); #else if (SCM_FIXABLE (val)) diff --git a/libguile/conv-uinteger.i.c b/libguile/conv-uinteger.i.c index f62dc41ad..2414b74b0 100644 --- a/libguile/conv-uinteger.i.c +++ b/libguile/conv-uinteger.i.c @@ -95,7 +95,7 @@ SCM_TO_TYPE_PROTO (SCM val) SCM SCM_FROM_TYPE_PROTO (TYPE val) { -#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_SCM_T_BITS +#if SIZEOF_TYPE != 0 && SIZEOF_TYPE < SIZEOF_UINTPTR_T return SCM_I_MAKINUM (val); #else if (SCM_POSFIXABLE (val)) diff --git a/libguile/gc.c b/libguile/gc.c index cf81b3ca9..0551e9c45 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -66,7 +66,7 @@ result of 'guile -c "(display (assq-ref (gc-stats) 'heap-total-allocated))"'. */ -#define DEFAULT_INITIAL_HEAP_SIZE (128 * 1024 * SIZEOF_SCM_T_BITS) +#define DEFAULT_INITIAL_HEAP_SIZE (128 * 1024 * SIZEOF_UINTPTR_T) /* Set this to != 0 if every cell that is accessed shall be checked: */ diff --git a/libguile/hashtab.c b/libguile/hashtab.c index 095ebca36..e675d6a7c 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -62,7 +62,7 @@ static unsigned long hashtable_size[] = { 31, 61, 113, 223, 443, 883, 1759, 3517, 7027, 14051, 28099, 56197, 112363, 224717, 449419, 898823, 1797641, 3595271, 7190537, 14381041 -#if SIZEOF_SCM_T_BITS > 4 +#if SIZEOF_UINTPTR_T > 4 /* vector lengths are stored in the first word of vectors, shifted by 8 bits for the tc8, so for 32-bit we only get 2^24-1 = 16777215 elements. But we allow a few more sizes for 64-bit. */ diff --git a/libguile/loader.c b/libguile/loader.c index 0d427b5e5..df9064883 100644 --- a/libguile/loader.c +++ b/libguile/loader.c @@ -48,14 +48,14 @@ /* This file contains the loader for Guile's on-disk format: ELF with some custom tags in the dynamic segment. */ -#if SIZEOF_SCM_T_BITS == 4 +#if SIZEOF_UINTPTR_T == 4 #define Elf_Half Elf32_Half #define Elf_Word Elf32_Word #define Elf_Ehdr Elf32_Ehdr #define ELFCLASS ELFCLASS32 #define Elf_Phdr Elf32_Phdr #define Elf_Dyn Elf32_Dyn -#elif SIZEOF_SCM_T_BITS == 8 +#elif SIZEOF_UINTPTR_T == 8 #define Elf_Half Elf64_Half #define Elf_Word Elf64_Word #define Elf_Ehdr Elf64_Ehdr diff --git a/libguile/socket.c b/libguile/socket.c index 7f21a5996..52f4ca194 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -181,8 +181,8 @@ SCM_DEFINE (scm_inet_makeaddr, "inet-makeaddr", 2, 0, 0, #endif -#if (SIZEOF_SCM_T_BITS * SCM_CHAR_BIT) > 128 -#error "Assumption that scm_t_bits <= 128 bits has been violated." +#if (SIZEOF_UINTPTR_T * SCM_CHAR_BIT) > 128 +#error "Assumption that uintptr_t <= 128 bits has been violated." #endif #if (SIZEOF_UNSIGNED_LONG * SCM_CHAR_BIT) > 128 diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 71dad5365..64deb96e3 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -1589,7 +1589,7 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp, scm_t_bits val; UNPACK_24 (op, dst); -#if SIZEOF_SCM_T_BITS > 4 +#if SIZEOF_UINTPTR_T > 4 val = ip[1]; val <<= 32; val |= ip[2];