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 /doc | |
| 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 'doc')
| -rw-r--r-- | doc/lispref/internals.texi | 11 |
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 | |||
| 1191 | can use only the parts of the module @acronym{API} that existed in | 1191 | can use only the parts of the module @acronym{API} that existed in |
| 1192 | that version, since those parts are identical in later versions. | 1192 | that 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 | ||
| 1196 | the 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 | ||
| 1199 | represent the version of Emacs that is currently running and has | ||
| 1200 | loaded your module. If you want your module to be compatible with | ||
| 1201 | various versions of @file{emacs-module.h} as well as various versions | ||
| 1202 | of Emacs, you can use conditional compilation based on | ||
| 1203 | @code{EMACS_MAJOR_VERSION}. | ||
| 1204 | |||
| 1194 | We recommend that modules always perform the compatibility | 1205 | We recommend that modules always perform the compatibility |
| 1195 | verification, unless they do their job entirely in the initialization | 1206 | verification, unless they do their job entirely in the initialization |
| 1196 | function, and don't access any Lisp objects or use any Emacs functions | 1207 | function, and don't access any Lisp objects or use any Emacs functions |