diff --git a/src/modules/gmpmod/configure.in b/src/modules/gmpmod/configure.in index 9cecf8fc308707082ad0c7bf1e23eff63bb10818..b8c1fa3b4afe39a8b85c5d1063174dd7395f44ee 100644 --- a/src/modules/gmpmod/configure.in +++ b/src/modules/gmpmod/configure.in @@ -8,22 +8,6 @@ AC_SUBST(RANLIB) AC_CHECK_HEADERS(gmp.h) AC_CHECK_LIB(gmp, mpz_set_si) -AC_MSG_CHECKING(if libgmp is new enough) -AC_CACHE_VAL(lpc_cv_lib_gmp_is_new_enough, -[ -AC_TRY_COMPILE([#include <gmp.h>],[ -mpz_t foo; -return 0; -],lpc_cv_lib_gmp_is_new_enough=yes,lpc_cv_lib_gmp_is_new_enough=no) -]) - -if test "$lpc_cv_lib_gmp_is_new_enough" = yes; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_NEW_GMP) -else - AC_MSG_RESULT(no) -fi - AC_OUTPUT(Makefile,echo FOO >stamp-h ) diff --git a/src/modules/gmpmod/gmp_machine.h.in b/src/modules/gmpmod/gmp_machine.h.in index d53e0cbc1ca1ea1073e6a158040bed3296db064f..0a79aef13b5e6bb3e9756f2369fd33595766c378 100644 --- a/src/modules/gmpmod/gmp_machine.h.in +++ b/src/modules/gmpmod/gmp_machine.h.in @@ -4,7 +4,4 @@ /* Define this if you have <gmp.h> */ #undef HAVE_GMP_H -/* Define this if your gmp is version 2.0 or newer */ -#undef HAVE_NEW_GMP - #endif diff --git a/src/modules/gmpmod/mpz_glue.c b/src/modules/gmpmod/mpz_glue.c index 5c2e502ec94de39ab9cf9f804b4e860b030d9fe6..944861b34021848ba340fa68ec80141f237bcfeb 100644 --- a/src/modules/gmpmod/mpz_glue.c +++ b/src/modules/gmpmod/mpz_glue.c @@ -7,10 +7,6 @@ #include "gmp_machine.h" #include "types.h" -#ifndef HAVE_NEW_GMP -#undef HAVE_GMP_H -#endif - #ifdef HAVE_GMP_H #include "interpret.h" @@ -25,12 +21,13 @@ #include <gmp.h> -#define THIS (*(mpz_t *)(fp->current_storage)) -#define OBTOMPZ(o) (*(mpz_t *)(o->storage)) + +#define THIS (*(MP_INT **)(fp->current_storage)) +#define OBTOMPZ(o) (*(MP_INT **)(o->storage)) static struct program *mpzmod_program; -static void get_new_mpz(mpz_t tmp, struct svalue *s) +static void get_new_mpz(MP_INT *tmp, struct svalue *s) { switch(s->type) { @@ -392,7 +389,7 @@ void init_gmpmod_programs(void) { #ifdef HAVE_GMP_H start_new_program(); - add_storage(sizeof(mpz_t)); + add_storage(sizeof(MP_INT *)); add_function("create",mpzmod_create,"function(void|string|int|float|object:void)",0);