diff options
author | Lisandro Dalcin <dalcinl@gmail.com> | 2017-10-27 15:33:51 +0300 |
---|---|---|
committer | Lisandro Dalcin <dalcinl@gmail.com> | 2017-10-27 15:33:51 +0300 |
commit | 4f636ed61c7f144b3926ec5b12f475e25adef06a (patch) | |
tree | 1651e1b0c26bc15ebcba2d77ba2f112108b0b7cd | |
parent | 0992c63ef803ae02d2d048f6b3097422dac89323 (diff) | |
download | cython-4f636ed61c7f144b3926ec5b12f475e25adef06a.tar.gz |
Add missing `extern` declaration for the `module_is_main` flag
-rw-r--r-- | Cython/Compiler/ModuleNode.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 3c04f0838..d6c322e2b 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -358,7 +358,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code = globalstate['before_global_var'] code.putln('#define __Pyx_MODULE_NAME "%s"' % self.full_module_name) - code.putln("int %s%s = 0;" % (Naming.module_is_main, self.full_module_name.replace('.', '__'))) + module_is_main = "%s%s" % (Naming.module_is_main, self.full_module_name.replace('.', '__')) + code.putln("extern int %s;" % module_is_main) + code.putln("int %s = 0;" % module_is_main) code.putln("") code.putln("/* Implementation of '%s' */" % env.qualified_name) |