diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2018-08-26 08:15:33 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2018-08-26 08:15:33 +0200 |
commit | a41070c709824fec59f9fa51008a40ff713743a9 (patch) | |
tree | 66e848696b9db0591512c4cf8cc8989988d4f2b8 /Cython/Compiler/ModuleNode.py | |
parent | 586097a56eeefe3d02909fc6d011a5337a0f3946 (diff) | |
download | cython-a41070c709824fec59f9fa51008a40ff713743a9.tar.gz |
Add a "CYTHON_HEX_VERSION" macro in the style of PY_HEX_VERSION that user code can use to detect the Cython version that generated the main module.
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r-- | Cython/Compiler/ModuleNode.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 98d9ebf7b..17cef09f2 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -27,7 +27,7 @@ from . import Pythran from .Errors import error, warning from .PyrexTypes import py_object_type -from ..Utils import open_new_file, replace_suffix, decode_filename +from ..Utils import open_new_file, replace_suffix, decode_filename, build_hex_version from .Code import UtilityCode, IncludeCode from .StringEncoding import EncodedString from .Pythran import has_np_pythran @@ -637,6 +637,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): from .. import __version__ code.putln('#define CYTHON_ABI "%s"' % __version__.replace('.', '_')) + code.putln('#define CYTHON_HEX_VERSION %s' % build_hex_version(__version__)) code.putln("#define CYTHON_FUTURE_DIVISION %d" % ( Future.division in env.context.future_directives)) |