summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-01-25 06:59:29 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-01-25 06:59:29 -0800
commit4b789435f8e4bb6ec9ea4bab3d0a109682adafa6 (patch)
tree65f91721ae512480ea4df6b9f7f493b35eab6660 /lib.h
parent4c71a77f2c39a8158c80b40af1a5cc2358251a00 (diff)
downloadtxr-4b789435f8e4bb6ec9ea4bab3d0a109682adafa6.tar.gz
txr-4b789435f8e4bb6ec9ea4bab3d0a109682adafa6.tar.bz2
txr-4b789435f8e4bb6ec9ea4bab3d0a109682adafa6.zip
Extend infrastructure for double_intptr_t.
We support an unsigned version of the type, and add functions for converting between Lisp values and both types. * arith.c (bignum_dbl_uipt): New function, unsigned companion to existing bignum_dbl_ipt. (c_dbl_num, c_dbl_unum): New functions. * arith.h (bignum_dbl_uipt, c_dbl_num, c_dbl_unum): Declared. * configure (superulong_t, SIZEOF_DOUBLE_INTPTR, DOUBLE_INTPTR_MAX, DOUBLE_INTPTR_MIN, DOUBLE_UINTPTR_MAX, double_uintptr_t): New definitions going into config.h. * lib.h (dbl_cnum, dbl_ucnum): New typedefs: double-sized analogs of cnum and ucnum. * mpi/mpi.c (mp_set_double_uintptr, mp_get_double_uintptr, mp_get_double_intptr): New functions. (s_mp_in_big_range): New static function. (mp_in_double_intptr_range, mp_in_double_uintptr_range): New functions. * mpi/mpi.h (mp_set_double_uintptr, mp_get_double_intptr, mp_get_double_uintptr, mp_in_double_intptr_range, mp_in_double_uintptr_range): Declared.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 04ba947b..64a08e3d 100644
--- a/lib.h
+++ b/lib.h
@@ -30,6 +30,11 @@
typedef int_ptr_t cnum;
typedef uint_ptr_t ucnum;
+#ifdef HAVE_DOUBLE_INTPTR_T
+typedef double_intptr_t dbl_cnum;
+typedef double_uintptr_t dbl_ucnum;
+#endif
+
#ifdef __cplusplus
#define strip_qual(TYPE, EXPR) (const_cast<TYPE>(EXPR))
#define convert(TYPE, EXPR) (static_cast<TYPE>(EXPR))