[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] Add module functions to convert from and to big integers
From: |
Philipp Stephani |
Subject: |
Re: [PATCH 2/2] Add module functions to convert from and to big integers. |
Date: |
Wed, 24 Apr 2019 18:57:40 +0200 |
Am Mi., 24. Apr. 2019 um 18:37 Uhr schrieb Philipp Stephani
<address@hidden>:
>
> Am Mi., 24. Apr. 2019 um 18:03 Uhr schrieb Eli Zaretskii <address@hidden>:
> >
> > > From: Philipp Stephani <address@hidden>
> > > Cc: Philipp Stephani <address@hidden>
> > > 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.
- Re: [PATCH 2/2] Add module functions to convert from and to big integers., (continued)
- Message not available
- Re: [PATCH 2/2] Add module functions to convert from and to big integers., Eli Zaretskii, 2019/04/24
- Re: [PATCH 2/2] Add module functions to convert from and to big integers., Philipp Stephani, 2019/04/24
- Re: [PATCH 2/2] Add module functions to convert from and to big integers., Eli Zaretskii, 2019/04/24
- Re: [PATCH 2/2] Add module functions to convert from and to big integers.,
Philipp Stephani <=
- Re: [PATCH 2/2] Add module functions to convert from and to big integers., Eli Zaretskii, 2019/04/24
- Re: [PATCH 2/2] Add module functions to convert from and to big integers., Philipp Stephani, 2019/04/24
- Re: [PATCH 2/2] Add module functions to convert from and to big integers., Eli Zaretskii, 2019/04/24
- Re: [PATCH 2/2] Add module functions to convert from and to big integers., Philipp Stephani, 2019/04/24
- [PATCH] Unbreak build when building without GMP support., Philipp Stephani, 2019/04/24
- Re: [PATCH] Unbreak build when building without GMP support., Eli Zaretskii, 2019/04/24
- Re: [PATCH] Unbreak build when building without GMP support., Philipp Stephani, 2019/04/24
- Re: [PATCH] Unbreak build when building without GMP support., Eli Zaretskii, 2019/04/24
- Re: [PATCH] Unbreak build when building without GMP support., Philipp Stephani, 2019/04/24
- Re: [PATCH] Unbreak build when building without GMP support., Eli Zaretskii, 2019/04/24