summaryrefslogtreecommitdiff
path: root/Cython/Utility/ModuleSetupCode.c
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2012-03-11 10:15:00 +0100
committerStefan Behnel <stefan_ml@behnel.de>2012-03-11 10:15:00 +0100
commit7026837eca3c8e62e05618065f6a53eaaae90faa (patch)
tree8588ede4ebe17755a94cab64fa6de87b6b9d8921 /Cython/Utility/ModuleSetupCode.c
parenta24894388e11bdb87adeb5ed9d7262d62e70d7ac (diff)
downloadcython-7026837eca3c8e62e05618065f6a53eaaae90faa.tar.gz
partial application of some PyPy related changes as far as they are uncontroversial and helpful for further utility code refactorings
--HG-- extra : transplant_source : %F8%87%C7%8B%90w%7E%8EG%04C%A9%89%9B%3E%FB%8CCp%F9
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r--Cython/Utility/ModuleSetupCode.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index e0287daa2..c243175ea 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -28,6 +28,20 @@
#define PY_LONG_LONG LONG_LONG
#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyCFunction_Call PyObject_Call
+#else
+ #define __Pyx_PyCFunction_Call PyCFunction_Call
+#endif
+
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX