aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPhilipp Stephani2019-04-24 10:22:18 +0200
committerPhilipp Stephani2019-04-28 20:08:25 +0200
commit4d97e1a9ea35c3a1d9f03abb7a822d57f384c1a5 (patch)
tree0ed9322698c302f7e2190f570102cc41112c0d86 /doc
parent24f717a5d7de80fdd6aa061f35d04144fe1c4e10 (diff)
downloademacs-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 'doc')
-rw-r--r--doc/lispref/internals.texi11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 5ae71afbef2..cfeb492af40 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -1191,6 +1191,17 @@ grow with new Emacs releases. Given the version of Emacs, the module
1191can use only the parts of the module @acronym{API} that existed in 1191can use only the parts of the module @acronym{API} that existed in
1192that version, since those parts are identical in later versions. 1192that version, since those parts are identical in later versions.
1193 1193
1194@file{emacs-module.h} defines a preprocessor macro
1195@code{EMACS_MAJOR_VERSION}. It expands to an integer literal which is
1196the latest major version of Emacs supported by the header.
1197@xref{Version Info}. Note that the value of
1198@code{EMACS_MAJOR_VERSION} is a compile-time constant and does not
1199represent the version of Emacs that is currently running and has
1200loaded your module. If you want your module to be compatible with
1201various versions of @file{emacs-module.h} as well as various versions
1202of Emacs, you can use conditional compilation based on
1203@code{EMACS_MAJOR_VERSION}.
1204
1194We recommend that modules always perform the compatibility 1205We recommend that modules always perform the compatibility
1195verification, unless they do their job entirely in the initialization 1206verification, unless they do their job entirely in the initialization
1196function, and don't access any Lisp objects or use any Emacs functions 1207function, and don't access any Lisp objects or use any Emacs functions