diff options
author | Philipp Stephani <phst@google.com> | 2019-04-18 22:38:29 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2019-04-24 12:53:54 +0200 |
commit | e290a7d1730c99010272bbff7f497c3041cef46d (patch) | |
tree | d17ccf1313e8b408c6e8cbef64e71a4f1311da4e /src/emacs-module.h.in | |
parent | bffceab6339fb4042588b893ef754c6264379e75 (diff) | |
download | emacs-e290a7d1730c99010272bbff7f497c3041cef46d.tar.gz |
Add module functions to convert from and to big integers.
* 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.
Diffstat (limited to 'src/emacs-module.h.in')
-rw-r--r-- | src/emacs-module.h.in | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in index bfbe226dd90..e61aadfc3ac 100644 --- a/src/emacs-module.h.in +++ b/src/emacs-module.h.in @@ -28,6 +28,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include <stdbool.h> #endif +#ifdef EMACS_MODULE_GMP +#include <gmp.h> +#endif + #if defined __cplusplus && __cplusplus >= 201103L # define EMACS_NOEXCEPT noexcept #else @@ -94,6 +98,12 @@ enum emacs_process_input_result emacs_process_input_quit = 1 }; +#ifdef EMACS_MODULE_GMP +struct emacs_mpz { mpz_t value; }; +#else +struct emacs_mpz; /* no definition */ +#endif + struct emacs_env_25 { @module_env_snippet_25@ |