From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: bignum branch Date: Thu, 09 Aug 2018 16:17:18 +0100 Message-ID: References: <87o9fbbw1t.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1533827787 444 195.159.176.226 (9 Aug 2018 15:16:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Aug 2018 15:16:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 09 17:16:23 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fnmfn-0008Sf-7L for ged-emacs-devel@m.gmane.org; Thu, 09 Aug 2018 17:16:23 +0200 Original-Received: from localhost ([::1]:51492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnmht-0001QI-Mk for ged-emacs-devel@m.gmane.org; Thu, 09 Aug 2018 11:18:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnmgt-0001Ou-2w for emacs-devel@gnu.org; Thu, 09 Aug 2018 11:17:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnmgp-0000HB-TJ for emacs-devel@gnu.org; Thu, 09 Aug 2018 11:17:31 -0400 Original-Received: from [195.159.176.226] (port=39887 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fnmgp-0000Gh-K8 for emacs-devel@gnu.org; Thu, 09 Aug 2018 11:17:27 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fnmeg-000797-5n for emacs-devel@gnu.org; Thu, 09 Aug 2018 17:15:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:VjjVpJ6Z0lDggIFh9zCApik62AA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228331 Archived-At: On Thu 09 Aug 2018, Charles A. Roelli wrote: >> From: Tom Tromey >> 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, 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;