aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Stephani2019-04-24 19:35:36 +0200
committerPhilipp Stephani2019-04-24 23:27:43 +0200
commit4eb7f9ef595c10df1ea78518b2f0410a0e79ec70 (patch)
treeb5721d7166a2b7d7285879bcb06b3a122182f6ff /src
parent553220fca670ec13180e0763bc9338fbf8ed4b30 (diff)
downloademacs-4eb7f9ef595c10df1ea78518b2f0410a0e79ec70.tar.gz
emacs-4eb7f9ef595c10df1ea78518b2f0410a0e79ec70.zip
Unbreak build when building without GMP support.
Add support for a new preprocessor macro EMACS_MODULE_HAVE_MPZ_T to emacs-module.h. If this macro is defined, assume that mpz_t is already defined and don’t include gmp.h. Don’t document the new macro for now, as it’s unclear whether we want to support this in modules outside the Emacs tree. * src/emacs-module.h.in: Allow user to prevent inclusion of gmp.h. * src/emacs-module.c: Use mini-gmp if GMP is unavailable. Don’t include gmp.h. * src/lisp.h: Don’t require gmp.h. It’s not needed for lisp.h. * test/Makefile.in (GMP_LIB, GMP_OBJ): New variables. ($(test_module)): Use them. * test/data/emacs-module/mod-test.c: Use mini-gmp if GMP is unavailable.
Diffstat (limited to 'src')
-rw-r--r--src/emacs-module.c7
-rw-r--r--src/emacs-module.h.in2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c
index b6a12386267..0b7b3d6ffbe 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -70,6 +70,11 @@ To add a new module function, proceed as follows:
70 70
71#include <config.h> 71#include <config.h>
72 72
73#ifndef HAVE_GMP
74#include "mini-gmp.h"
75#define EMACS_MODULE_HAVE_MPZ_T
76#endif
77
73#define EMACS_MODULE_GMP 78#define EMACS_MODULE_GMP
74#include "emacs-module.h" 79#include "emacs-module.h"
75 80
@@ -80,8 +85,6 @@ To add a new module function, proceed as follows:
80#include <stdlib.h> 85#include <stdlib.h>
81#include <time.h> 86#include <time.h>
82 87
83#include <gmp.h>
84
85#include "lisp.h" 88#include "lisp.h"
86#include "bignum.h" 89#include "bignum.h"
87#include "dynlib.h" 90#include "dynlib.h"
diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in
index e61aadfc3ac..fbc62a61ef4 100644
--- a/src/emacs-module.h.in
+++ b/src/emacs-module.h.in
@@ -28,7 +28,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
28#include <stdbool.h> 28#include <stdbool.h>
29#endif 29#endif
30 30
31#ifdef EMACS_MODULE_GMP 31#if defined EMACS_MODULE_GMP && !defined EMACS_MODULE_HAVE_MPZ_T
32#include <gmp.h> 32#include <gmp.h>
33#endif 33#endif
34 34