diff options
| author | Philipp Stephani | 2019-04-24 19:35:36 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2019-04-24 23:27:43 +0200 |
| commit | 4eb7f9ef595c10df1ea78518b2f0410a0e79ec70 (patch) | |
| tree | b5721d7166a2b7d7285879bcb06b3a122182f6ff /src/emacs-module.c | |
| parent | 553220fca670ec13180e0763bc9338fbf8ed4b30 (diff) | |
| download | emacs-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/emacs-module.c')
| -rw-r--r-- | src/emacs-module.c | 7 |
1 files changed, 5 insertions, 2 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" |