diff options
author | Mark H Weaver <mhw@netris.org> | 2013-03-28 22:24:00 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2013-03-28 22:24:00 -0400 |
commit | c33ecf96a41979be0af1d56a7e12ad7c1196f12b (patch) | |
tree | 35e2f32f49f210dced293e77612a7130445281c9 /libguile | |
parent | 26d148066f9cb20e395a7dc4fefdf2e2ef0b2fb0 (diff) | |
parent | 4702deb424633ad02c495c01d950b973c0ead8ea (diff) | |
download | guile-c33ecf96a41979be0af1d56a7e12ad7c1196f12b.tar.gz |
Merge remote-tracking branch 'origin/stable-2.0'
Diffstat (limited to 'libguile')
-rw-r--r-- | libguile/generalized-arrays.c | 2 | ||||
-rw-r--r-- | libguile/numbers.c | 31 |
2 files changed, 31 insertions, 2 deletions
diff --git a/libguile/generalized-arrays.c b/libguile/generalized-arrays.c index 9382e817e..59925a09e 100644 --- a/libguile/generalized-arrays.c +++ b/libguile/generalized-arrays.c @@ -135,7 +135,7 @@ SCM_DEFINE (scm_array_length, "array-length", 1, 0, 0, (SCM array), "Return the length of an array: its first dimension.\n" "It is an error to ask for the length of an array of rank 0.") -#define FUNC_NAME s_scm_array_rank +#define FUNC_NAME s_scm_array_length { return scm_from_size_t (scm_c_array_length (array)); } diff --git a/libguile/numbers.c b/libguile/numbers.c index 29d266984..d941133df 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -1,4 +1,6 @@ -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + * 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, + * 2013 Free Software Foundation, Inc. * * Portions Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories * and Bellcore. See scm_divide. @@ -56,6 +58,8 @@ #include <complex.h> #endif +#include <stdarg.h> + #include "libguile/_scm.h" #include "libguile/feature.h" #include "libguile/ports.h" @@ -96,6 +100,31 @@ typedef scm_t_signed_bits scm_t_inum; #define DOUBLE_IS_POSITIVE_INFINITY(x) (isinf(x) && ((x) > 0)) #define DOUBLE_IS_NEGATIVE_INFINITY(x) (isinf(x) && ((x) < 0)) + +#if ! HAVE_DECL_MPZ_INITS + +/* GMP < 5.0.0 lacks `mpz_inits' and `mpz_clears'. Provide them. */ + +#define VARARG_MPZ_ITERATOR(func) \ + static void \ + func ## s (mpz_t x, ...) \ + { \ + va_list ap; \ + \ + va_start (ap, x); \ + while (x != NULL) \ + { \ + func (x); \ + x = va_arg (ap, mpz_ptr); \ + } \ + va_end (ap); \ + } + +VARARG_MPZ_ITERATOR (mpz_init) +VARARG_MPZ_ITERATOR (mpz_clear) + +#endif + /* |