diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2018-02-14 21:53:03 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2018-02-14 21:53:03 +0100 |
commit | f56f402da62e7395fe31ef4a7b17df887d197576 (patch) | |
tree | 1902c54348ca5ae231c4239756110840b1351dc8 /Cython/Compiler/ModuleNode.py | |
parent | 74173e2ed51d3d67e74fbf48531895ee789363de (diff) | |
download | cython-f56f402da62e7395fe31ef4a7b17df887d197576.tar.gz |
Make CYTHON_SMALL_CODE macro work with g++.
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r-- | Cython/Compiler/ModuleNode.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 954e86841..7cee61d3a 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -2280,10 +2280,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): header3 = "__Pyx_PyMODINIT_FUNC %s(void)" % self.mod_init_func_cname('PyInit', env) code.putln("#if PY_MAJOR_VERSION < 3") # Optimise for small code size as the module init function is only executed once. - code.putln("CYTHON_SMALL_CODE %s; /*proto*/" % header2) + code.putln("%s CYTHON_SMALL_CODE; /*proto*/" % header2) code.putln(header2) code.putln("#else") - code.putln("CYTHON_SMALL_CODE %s; /*proto*/" % header3) + code.putln("%s CYTHON_SMALL_CODE; /*proto*/" % header3) code.putln(header3) # CPython 3.5+ supports multi-phase module initialisation (gives access to __spec__, __file__, etc.) @@ -2297,7 +2297,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("") # main module init code lives in Py_mod_exec function, not in PyInit function - code.putln("CYTHON_SMALL_CODE static int %s(PyObject *%s)" % ( + code.putln("static int %s(PyObject *%s) CYTHON_SMALL_CODE " % ( self.mod_init_func_cname(Naming.pymodule_exec_func_cname, env), Naming.pymodinit_module_arg)) code.putln("#endif") # PEP489 |