From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.devel
Subject: Re: [PATCH 2/2] Add module functions to convert from and to big
integers.
Date: Wed, 24 Apr 2019 18:57:40 +0200
Message-ID:
References: <329aec43-8272-f39a-e7ef-e77804103a50@cs.ucla.edu>
<20190423213218.35618-1-phst@google.com>
<20190423213218.35618-2-phst@google.com> <837ebj2xx0.fsf@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226";
logging-data="233724"; mail-complaints-to="usenet@blaine.gmane.org"
Cc: Philipp Stephani , Paul Eggert ,
Emacs developers
To: Eli Zaretskii
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 24 19:00:47 2019
Return-path:
Envelope-to: ged-emacs-devel@m.gmane.org
Original-Received: from lists.gnu.org ([209.51.188.17])
by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256)
(Exim 4.89)
(envelope-from )
id 1hJLGI-000yfe-Qs
for ged-emacs-devel@m.gmane.org; Wed, 24 Apr 2019 19:00:46 +0200
Original-Received: from localhost ([127.0.0.1]:44560 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1hJLGH-0006hk-RZ
for ged-emacs-devel@m.gmane.org; Wed, 24 Apr 2019 13:00:45 -0400
Original-Received: from eggs.gnu.org ([209.51.188.92]:50226)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1hJLDK-000586-Jb
for emacs-devel@gnu.org; Wed, 24 Apr 2019 12:57:43 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1hJLDJ-0006iV-3o
for emacs-devel@gnu.org; Wed, 24 Apr 2019 12:57:42 -0400
Original-Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:35709)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from )
id 1hJLDF-0006ZO-9L; Wed, 24 Apr 2019 12:57:37 -0400
Original-Received: by mail-oi1-x241.google.com with SMTP id y6so1245611oih.2;
Wed, 24 Apr 2019 09:57:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=NI++ePZKARbuj+Fz1YEUj7AjHGAPsHQbSsG37Iq6ybU=;
b=XiH/N51TwTjint671wY4h2cvD02tE4ofX/xHTBayee3gLKLlUpss/KnHb/H65H8J6R
w1L16aYM7Lcv944GCyjZpiOM+QFI7r51mrST3XdzNjdPIxMsKcQ2I3PUpvZYcb448dhS
csifKArFBXGSxQulN3oJvShXI6GhB/wUflJccvEfZQOjozm/kxcTqkT1VdxIrEpmvquY
QHPmWclf9ZSLktcnU8ltKqIQQKxgipwFSff62KHdXJfuzyRJRAAQOPEmmWImug4nxYav
1nsVa0SmbRARFAYqxsRjmL+vd13XvKg/Uwg8mc56MalzbTvt6pkhV5d1it62eLWxpQyt
nQag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=NI++ePZKARbuj+Fz1YEUj7AjHGAPsHQbSsG37Iq6ybU=;
b=C39DDN2IDgnLQZPWOM8vutX5U+vd5Eld7NW88DK1v+Ybi+3UJmfyuIil7sr6+0/Ldf
4XV9VuUlXctAfmNigzU0QKzeLHThss74Bcp4FJZU2ROa0C6XtmvB3F1NKGiuImpWn9zO
WmTfmXz3GV/7DD87j/o2P/5R/V+Klg30diTkKT+M8/CQUwDuzlY8SAP99EghCuDvPvke
sp+M6jchMA+FAnOamZOxilk6235ShRiy6vEJhPtSjoQho+eki3qoIAK5KoWoSH4Tnx6A
Li6iP3c8MYbbUWLTz4Y4RkQl0PmrX5uTvVI6v3trSayuKpGAEDSuuQ0RLFycOKHewWEu
eVww==
X-Gm-Message-State: APjAAAX17jLQ9MS+qXDluRcaop/Fvhe5dCnfTTJ/giS4kgN3nM5qH7Vj
l2NxM5ORMs2MqJ0T764LEK31sadf6RO/1e+oip6Pog==
X-Google-Smtp-Source: APXvYqzGgbNvKSH4PH7XS/AK03j94EOd42P80luMuRxYeZadqio1fTU8WQ4qBuJaNFu9/r/2hLM2g76mUUvYQMLMig0=
X-Received: by 2002:aca:b3c2:: with SMTP id c185mr48596oif.98.1556125055700;
Wed, 24 Apr 2019 09:57:35 -0700 (PDT)
In-Reply-To:
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 2607:f8b0:4864:20::241
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:235868
Archived-At:
Am Mi., 24. Apr. 2019 um 18:37 Uhr schrieb Philipp Stephani
:
>
> Am Mi., 24. Apr. 2019 um 18:03 Uhr schrieb Eli Zaretskii :
> >
> > > From: Philipp Stephani
> > > Cc: Philipp Stephani
> > > Date: Tue, 23 Apr 2019 23:32:18 +0200
> > >
> > > * src/module-env-27.h: Add new module functions to convert big
> > > integers.
> > >
> > > * src/emacs-module.h.in (emacs_mpz): Define if GMP is available.
> > >
> > > * src/emacs-module.c (module_extract_big_integer)
> > > (module_make_big_integer): New functions.
> > > (initialize_environment): Use them.
> > >
> > > * test/data/emacs-module/mod-test.c (Fmod_test_double): New test
> > > function.
> > > (emacs_module_init): Define it.
> > >
> > > * test/src/emacs-module-tests.el (mod-test-double): New unit test.
> > >
> > > * doc/lispref/internals.texi (Module Values): Document new functions.
> >
> > These changes break the Emacs build on platforms where GMP is not
> > available and Emacs uses mini-gmp.c. In particular, lisp.h amd
> > emacs-module.c unconditionally define EMACS_MODULE_GMP, which then
> > causes emacs-module.h include gmp.h, whose defionitions conflict with
> > mini-gmp.h.
> >
> > It is also not clear whether the new emacs-module facilities are
> > compatible with mini-gmp, i.e. whether mini-gmp can support the above
> > interfaces in emacs-module. because if they can, we have a problem:
> > emacs-module.h cannot include mini-gmp.h, AFAIU, where the relevant
> > structures and macros are defined instead of system-wide gmp.h.
>
> Thanks, I'll see whether I can make this work.
Right now I see 2 options:
1. Don't support these functions at all if GMP isn't available (i.e.
signal an error unconditionally)
2. Add another preprocessor macro that would stop emacs-module.h from
including gmp.h.
(1) seems a bit easier and cleaner, but means that we wouldn't support
these functions if Emacs isn't compiled with GMP support.