summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorJimKleckner <none@none>2008-08-15 01:56:03 -0700
committerJimKleckner <none@none>2008-08-15 01:56:03 -0700
commit9035ac46ac76bef176850349729984de2038be6f (patch)
tree383855c061ea9a2f4f3880d29d4b7e0dead51da5 /Cython/Compiler/ModuleNode.py
parentd90d245533ab0a42263558cb48244d9dabad303b (diff)
downloadcython-9035ac46ac76bef176850349729984de2038be6f.tar.gz
Windos __stdcall and _USE_MATH_DEFINES
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index efc56c56b..093aef8e8 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -489,12 +489,17 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln(" #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)")
code.putln("#endif")
- code.putln("#ifndef __stdcall")
- code.putln(" #define __stdcall")
- code.putln("#endif")
- code.putln("#ifndef __cdecl")
- code.putln(" #define __cdecl")
+ code.putln("#if !defined(WIN32) && !defined(MS_WINDOWS)")
+ code.putln(" #ifndef __stdcall")
+ code.putln(" #define __stdcall")
+ code.putln(" #endif")
+ code.putln(" #ifndef __cdecl")
+ code.putln(" #define __cdecl")
+ code.putln(" #endif")
+ code.putln("#else")
+ code.putln(" #define _USE_MATH_DEFINES")
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))