From: JimKleckner Date: Fri, 15 Aug 2008 08:56:03 +0000 (-0700) Subject: Windos __stdcall and _USE_MATH_DEFINES X-Git-Tag: 0.9.8.1~44 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9035ac46ac76bef176850349729984de2038be6f;p=cython.git Windos __stdcall and _USE_MATH_DEFINES --- diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index efc56c56..093aef8e 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 ") code.putln("#define %s" % Naming.api_guard_prefix + self.api_name(env))