summaryrefslogtreecommitdiffstats
path: root/itypes.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-01-23 06:58:38 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-01-23 06:58:38 -0800
commitb333ea2900a2e7c10d7b5cd35bf250c8e2d8d40f (patch)
treef0cd73c36dd467cefe1506326e6d0c23bda28a8d /itypes.c
parentf64d0bb5e0bfff833936d63849f86510a2328fee (diff)
downloadtxr-b333ea2900a2e7c10d7b5cd35bf250c8e2d8d40f.tar.gz
txr-b333ea2900a2e7c10d7b5cd35bf250c8e2d8d40f.tar.bz2
txr-b333ea2900a2e7c10d7b5cd35bf250c8e2d8d40f.zip
Fix some instances of 4 bytes = 32 bits assumption.
* hash.c (equal_hash, eql_hash, cobj_eq_hash_op, hash_hash_op): Multiply object size by CHAR_BIT and switch on number of bits, rather than bytes. * sysif.c (off_t_num): Likewise. * arith.c, ffi.c, itypes.c, rand.c: In numerous #if directive, fix size tests from bytes to bits. * configure: in the test that detects integer types, and in the test for enabling large file offsets, detect one more variable from the system: the value of CHAR_BIT. This turns into SIZEOF_BYTE. We use that value instead of a hard-coded 8.
Diffstat (limited to 'itypes.c')
-rw-r--r--itypes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/itypes.c b/itypes.c
index a0a10e4e..5c1e3e69 100644
--- a/itypes.c
+++ b/itypes.c
@@ -98,7 +98,7 @@ u32_t c_u32(val n, val self)
#endif
#if HAVE_I64
-#if SIZEOF_PTR == 8
+#if CHAR_BIT * SIZEOF_PTR == 64
i64_t c_i64(val n, val self)
{
cnum v = c_num(n);