From: Dag Sverre Seljebotn Date: Wed, 20 May 2009 18:11:13 +0000 (+0200) Subject: Stop compilation when Python headers are not present X-Git-Tag: 0.12.alpha0~224^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7997dd38759cbbdf134a55dd9bd6f453b682d4e7;p=cython.git Stop compilation when Python headers are not present --- diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py index 48fbbd01..2a426fe3 100644 --- a/Cython/Compiler/Code.py +++ b/Cython/Compiler/Code.py @@ -236,7 +236,8 @@ class GlobalState(object): 'before_global_var', 'global_var', 'all_the_rest', - 'utility_code_def' + 'utility_code_def', + 'end' ] diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 32be4c71..63b72a3a 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -425,7 +425,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln('#include "%s"' % filename) code.putln("#ifndef Py_PYTHON_H") code.putln(" #error Python headers needed to compile C extensions, please install development version of Python.") - code.putln("#endif") + code.putln("#else") + code.globalstate["end"].putln("#endif /* Py_PYTHON_H */") code.putln("#ifndef PY_LONG_LONG") code.putln(" #define PY_LONG_LONG LONG_LONG") code.putln("#endif")