[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bignum branch
From: |
Charles A. Roelli |
Subject: |
Re: bignum branch |
Date: |
Thu, 09 Aug 2018 18:23:34 +0200 |
> From: Andy Moreton <address@hidden>
> Date: Thu, 09 Aug 2018 16:17:18 +0100
>
> > Where should that symbol be defined?
>
> It's defined in gmp.h from the GMP library. If you are building without
> GMP installed, then emacs uses an internal copy of the GMP library's
> simplified version from src/mini-gmp.[ch].
>
> It appears that mini-gmp does not define GMP_NUMB_BITS, so does this
> patch work for you instead ?
>
> Thanks for testing,
>
> AndyM
>
> diff --git a/src/alloc.c b/src/alloc.c
> index 1504d7912b..a8bc55beb4 100644
> --- a/src/alloc.c
> +++ b/src/alloc.c
> @@ -3830,7 +3830,7 @@ make_number (mpz_t value)
> for (i = 0; i < limbs; i++)
> {
> mp_limb_t limb = mpz_getlimbn (value, i);
> - v |= (EMACS_INT) ((EMACS_UINT) limb << (i * GMP_NUMB_BITS));
> + v |= (EMACS_INT) ((EMACS_UINT) limb << (i * mp_bits_per_limb));
> }
> if (sign < 0)
> v = -v;
Thanks, Emacs now builds and runs with this patch installed locally.
I also ran "make check" in this configuration (with GMP uninstalled)
and it seems that none of the bignum-related tests have failed.