diff options
| author | Philipp Stephani | 2019-04-24 10:22:18 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2019-04-28 20:08:25 +0200 |
| commit | 4d97e1a9ea35c3a1d9f03abb7a822d57f384c1a5 (patch) | |
| tree | 0ed9322698c302f7e2190f570102cc41112c0d86 /test | |
| parent | 24f717a5d7de80fdd6aa061f35d04144fe1c4e10 (diff) | |
| download | emacs-4d97e1a9ea35c3a1d9f03abb7a822d57f384c1a5.tar.gz emacs-4d97e1a9ea35c3a1d9f03abb7a822d57f384c1a5.zip | |
Export major version of latest Emacs supported by emacs-module.h.
This is useful if module authors want to support multiple versions of
emacs-module.h.
* configure.ac (emacs_major_version): Define substitution.
* src/emacs-module.h.in (EMACS_MAJOR_VERSION): Define macro.
* doc/lispref/internals.texi (Module Initialization): Document
EMACS_MAJOR_VERSION preprocessor macro.
* test/data/emacs-module/mod-test.c (emacs_module_init): Verify
behavior of EMACS_MAJOR_VERSION.
Diffstat (limited to 'test')
| -rw-r--r-- | test/data/emacs-module/mod-test.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c index b7007bd80ff..a9154fa167d 100644 --- a/test/data/emacs-module/mod-test.c +++ b/test/data/emacs-module/mod-test.c | |||
| @@ -445,6 +445,11 @@ bind_function (emacs_env *env, const char *name, emacs_value Sfun) | |||
| 445 | int | 445 | int |
| 446 | emacs_module_init (struct emacs_runtime *ert) | 446 | emacs_module_init (struct emacs_runtime *ert) |
| 447 | { | 447 | { |
| 448 | /* Check that EMACS_MAJOR_VERSION is defined and an integral | ||
| 449 | constant. */ | ||
| 450 | char dummy[EMACS_MAJOR_VERSION]; | ||
| 451 | assert (27 <= sizeof dummy); | ||
| 452 | |||
| 448 | if (ert->size < sizeof *ert) | 453 | if (ert->size < sizeof *ert) |
| 449 | { | 454 | { |
| 450 | fprintf (stderr, "Runtime size of runtime structure (%"pT" bytes) " | 455 | fprintf (stderr, "Runtime size of runtime structure (%"pT" bytes) " |