[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bignum branch

From: Andy Moreton
Subject: Re: bignum branch
Date: Thu, 09 Aug 2018 16:17:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)

On Thu 09 Aug 2018, Charles A. Roelli wrote:

>> From: Tom Tromey <address@hidden>
>> Date: Thu, 12 Jul 2018 22:26:38 -0600
>> I've pushed the bignum branch to emacs git, as feature/bignum.
>> Please read through it and try it out, and reply to this message with
>> your comments.
>> thanks,
>> Tom
> Thanks.  It now works on macOS too (with GMP 6.1.1 installed), after
> replacing the old macros used in NS-related files.
> However, when building without GMP installed, I get this:
>   CC       alloc.o
> alloc.c: In function ‘make_number’:
> alloc.c:3833: error: ‘GMP_NUMB_BITS’ undeclared (first use in this function)
> alloc.c:3833: error: (Each undeclared identifier is reported only once
> alloc.c:3833: error: for each function it appears in.)
> 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,


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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]