Emit code to guard declarations for this module's public functions.
authorjek-cythonhg@kleckner.net <none@none>
Sat, 24 May 2008 00:58:47 +0000 (17:58 -0700)
committerjek-cythonhg@kleckner.net <none@none>
Sat, 24 May 2008 00:58:47 +0000 (17:58 -0700)
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.

Cython/Compiler/ModuleNode.py

index 5f8fcd97e974ba5af4bf1dae02f10fbc14ae8731..1fb70945a403a6ab869aa8bc5cac1e00881f9d24 100644 (file)
@@ -473,6 +473,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
         code.putln("#endif")
         self.generate_extern_c_macro_definition(code)
         code.putln("#include <math.h>")
+        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)