summaryrefslogtreecommitdiff
path: root/libguile/srfi-4.i.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2005-01-14 18:19:13 +0000
committerMarius Vollmer <mvo@zagadka.de>2005-01-14 18:19:13 +0000
commit00c17d45262defe568a3c628c403cdcdf57fd69a (patch)
tree142e705a576db6654d98372e5370af2282bf46ac /libguile/srfi-4.i.c
parent55fcbb966b95006ce54a5d648f00087c41e802e6 (diff)
downloadguile-00c17d45262defe568a3c628c403cdcdf57fd69a.tar.gz
(scm_take_u64vector,
scm_array_handle_u64_elements, scm_array_handle_u64_writable_elements, scm_u64vector_elements, scm_u64vector_writable_elements): Do not define when scm_t_uint64 is not available. (scm_take_s64vector, scm_array_handle_s64_elements, scm_array_handle_s64_writable_elements, scm_s64vector_elements, scm_s64vector_writable_elements): Likewise for scm_t_int64. (uvec_sizes, uvec_print, uvec_equalp): Use SCM bignums when scm_t_int64/scm_t_uint64 are not available. (uvec_mark): New, to mark the bignums. (alloc_uvec): Initialize bignums. (uvec_fast_ref): Return bignums directly. (scm_uint64_min, scm_uint64_max, scm_int64_min, scm_int64_max, assert_exact_integer): New. (uvec_fast_set): Use them to validate the bignums. (scm_init_srfi_4): Set mark function of smob when needed. Initialize scm_uint64_min, scm_uint64_max, scm_int64_min, scm_int64_max.
Diffstat (limited to 'libguile/srfi-4.i.c')
-rw-r--r--libguile/srfi-4.i.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/libguile/srfi-4.i.c b/libguile/srfi-4.i.c
index e1c3598c4..101eb386c 100644
--- a/libguile/srfi-4.i.c
+++ b/libguile/srfi-4.i.c
@@ -21,6 +21,8 @@
The C type of the elements, for example scm_t_uint8. The code
below will never do sizeof (CTYPE), thus you can use just 'float'
for the c32 type, for example.
+
+ When CTYPE is not defined, the functions using it are excluded.
*/
/* The first level does not expand macros in the arguments. */
@@ -55,14 +57,6 @@ SCM_DEFINE (F(scm_make_,TAG,vector), "make-"S(TAG)"vector", 1, 1, 0,
}
#undef FUNC_NAME
-SCM
-F(scm_take_,TAG,vector) (const CTYPE *data, size_t n)
-{
- scm_gc_register_collectable_memory ((void *)data, n*uvec_sizes[TYPE],
- uvec_names[TYPE]);
- return take_uvec (TYPE, data, n);
-}
-
SCM_DEFINE (F(scm_,TAG,vector), S(TAG)"vector", 0, 0, 1,
(SCM l),
"Return a newly allocated uniform numeric vector containing\n"
@@ -138,6 +132,16 @@ SCM_DEFINE (F(scm_any_to_,TAG,vector), "any->"S(TAG)"vector", 1, 0, 0,
}
#undef FUNC_NAME
+#ifdef CTYPE
+
+SCM
+F(scm_take_,TAG,vector) (const CTYPE *data, size_t n)
+{
+ scm_gc_register_collectable_memory ((void *)data, n*uvec_sizes[TYPE],
+ uvec_names[TYPE]);
+ return take_uvec (TYPE, data, n);
+}
+
const CTYPE *
F(scm_array_handle_,TAG,_elements) (scm_t_array_handle *h)
{
@@ -180,6 +184,8 @@ F(scm_,TAG,vector_writable_elements) (SCM uvec,
return F(scm_array_handle_,TAG,_writable_elements) (h);
}
+#endif
+
static SCM
F(,TAG,ref) (scm_t_array_handle *handle, ssize_t pos)
{