From: jek-cythonhg@kleckner.net Date: Sat, 24 May 2008 00:58:47 +0000 (-0700) Subject: Emit code to guard declarations for this module's public functions. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8a8e77d1407c9fee729fabdafae681d6d581d277;p=cython.git Emit code to guard declarations for this module's public functions. It appears that the machinery is all there to protect the declaration of inconsistent linkage types (i.e. dllimport vs. dllexport) by using a guard unique to the pyx file. This patch simply emits that guard for the current module to prevent the error "inconsistent linkage types" on a Windows-based system. --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 5f8fcd97..1fb70945 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -473,6 +473,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("#endif") self.generate_extern_c_macro_definition(code) code.putln("#include ") + code.putln("#define %s" % Naming.api_guard_prefix + self.api_name(env)) self.generate_includes(env, cimported_modules, code) code.putln('') code.put(Nodes.utility_function_predeclarations)