summaryrefslogtreecommitdiff
path: root/libguile/integers.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2022-01-06 21:04:23 +0100
committerAndy Wingo <wingo@pobox.com>2022-01-13 09:37:17 +0100
commit717e787da6ae75bbaa53139c0ef3791cd758a9d8 (patch)
tree8d00b014c26883916b4e62d75d6f1a06ff7bc6be /libguile/integers.h
parent27910181c53a7f836bfc8dc9c5619e2e3110eeaf (diff)
downloadguile-717e787da6ae75bbaa53139c0ef3791cd758a9d8.tar.gz
Reimplement scm_{to,from}_{int32,uint32}
* libguile/numbers.c (scm_to_int32, scm_from_int32, scm_to_uint32): (scm_from_uint32): Reimplement inline. * libguile/integers.c (make_bignum_2): (make_bignum_from_uint64): (negative_uint32_to_int32): (positive_uint32_to_int32): (bignum_to_int32): (bignum_to_uint32): (scm_integer_from_int32): (scm_integer_from_uint32): (scm_integer_to_int32_z): (scm_integer_to_uint32_z): Better int32 support for 32-bit machines.
Diffstat (limited to 'libguile/integers.h')
-rw-r--r--libguile/integers.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libguile/integers.h b/libguile/integers.h
index 8bf91f567..f8d150119 100644
--- a/libguile/integers.h
+++ b/libguile/integers.h
@@ -199,9 +199,15 @@ SCM_INTERNAL SCM scm_integer_exact_quotient_zi (struct scm_bignum *n,
SCM_INTERNAL SCM scm_integer_exact_quotient_zz (struct scm_bignum *n,
struct scm_bignum *d);
+#if SCM_SIZEOF_LONG == 4
+SCM_INTERNAL SCM scm_integer_from_int32 (int32_t n);
+SCM_INTERNAL SCM scm_integer_from_uint32 (uint32_t n);
+SCM_INTERNAL int scm_integer_to_int32_z (struct scm_bignum *z, int32_t *val);
+SCM_INTERNAL int scm_integer_to_uint32_z (struct scm_bignum *z, uint32_t *val);
+#endif
+
SCM_INTERNAL int scm_integer_to_int64_z (struct scm_bignum *z, int64_t *val);
SCM_INTERNAL int scm_integer_to_uint64_z (struct scm_bignum *z, uint64_t *val);
-
SCM_INTERNAL SCM scm_integer_from_int64 (int64_t n);
SCM_INTERNAL SCM scm_integer_from_uint64 (uint64_t n);