diff options
author | Ludovic Courtès <ludo@gnu.org> | 2011-04-25 22:36:30 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2011-04-25 22:36:30 +0200 |
commit | bbec4602457ed3e139e9dae99b4b495a3bc5eb71 (patch) | |
tree | 2f2c922fb2a32a1ff1475cc03143efbe0014a0cc | |
parent | 4a235623391dd0d3d46f87dcf00d152e1787c191 (diff) | |
download | guile-bbec4602457ed3e139e9dae99b4b495a3bc5eb71.tar.gz |
Make the `sizeof (mpz_t)' check at compile-time.
* libguile/init.c (scm_i_init_guile): Remove the `sizeof (mpz_t)'
run-time check.
* libguile/numbers.c: Add a compile-time check for `sizeof (mpz_t)'.
-rw-r--r-- | libguile/init.c | 7 | ||||
-rw-r--r-- | libguile/numbers.c | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/libguile/init.c b/libguile/init.c index 874184615..94de5c90a 100644 --- a/libguile/init.c +++ b/libguile/init.c @@ -381,13 +381,6 @@ scm_i_init_guile (void *base) if (scm_initialized_p) return; - if (sizeof (mpz_t) > (3 * sizeof (scm_t_bits))) - { - fprintf (stderr, - "GMP's mpz_t must fit into a double_cell," - "but doesn't seem to here.\n"); - } - scm_storage_prehistory (); scm_threads_prehistory (base); /* requires storage_prehistory */ scm_weaks_prehistory (); /* requires storage_prehistory */ diff --git a/libguile/numbers.c b/libguile/numbers.c index 74753812b..742f4d1fe 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -45,6 +45,8 @@ # include <config.h> #endif +#include <verify.h> + #include <math.h> #include <string.h> #include <unicase.h> @@ -68,6 +70,9 @@ #include "libguile/eq.h" +/* GMP's `mpz_t' must fit into a double cell. */ +verify (sizeof (mpz_t) <= (2 * sizeof (scm_t_bits))); + /* values per glibc, if not already defined */ #ifndef M_LOG10E #define M_LOG10E 0.43429448190325182765 |