From 9035ac46ac76bef176850349729984de2038be6f Mon Sep 17 00:00:00 2001 From: JimKleckner Date: Fri, 15 Aug 2008 01:56:03 -0700 Subject: [PATCH] Windos __stdcall and _USE_MATH_DEFINES --- Cython/Compiler/ModuleNode.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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)) -- 2.26.2