Skip to content
Snippets Groups Projects
Commit bc7ca8c9 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

should now work with older versions of GMP

Rev: src/modules/gmpmod/configure.in:1.4
Rev: src/modules/gmpmod/gmp_machine.h.in:1.3
Rev: src/modules/gmpmod/mpz_glue.c:1.4
parent ea533099
No related branches found
No related tags found
No related merge requests found
......@@ -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 )
......@@ -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
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment