1) Stefan, I had to push this fix, just to be sure, please double check. https://github.com/cython/cython/commit/6bd3f7b9e494d1259082aecfc0366da15fc1... 2) PyPy3 defines some legacy (Py2) Py_TPFLAGS_XXX values. Do you like the following fix? IOW, I check if the value is #define'd, if not I #define it to 0 (zero): diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index 6477fb2..3ae8a0c 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -59,13 +59,16 @@ #define __Pyx_DefaultClassType PyType_Type #endif -#if PY_MAJOR_VERSION >= 3 +#if !defined(Py_TPFLAGS_CHECKTYPES) #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#if !defined(Py_TPFLAGS_HAVE_INDEX) #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if !defined(Py_TPFLAGS_HAVE_NEWBUFFER) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif - -#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) +#if !defined(Py_TPFLAGS_HAVE_FINALIZE) #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif -- Lisandro Dalcin ============ Research Scientist Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) Numerical Porous Media Center (NumPor) King Abdullah University of Science and Technology (KAUST) http://numpor.kaust.edu.sa/ 4700 King Abdullah University of Science and Technology al-Khawarizmi Bldg (Bldg 1), Office # 4332 Thuwal 23955-6900, Kingdom of Saudi Arabia http://www.kaust.edu.sa Office Phone: +966 12 808-0459
Lisandro Dalcin schrieb am 08.03.2015 um 20:25:
1) Stefan, I had to push this fix, just to be sure, please double check.
https://github.com/cython/cython/commit/6bd3f7b9e494d1259082aecfc0366da15fc1...
Thanks - sorry for the bug.
2) PyPy3 defines some legacy (Py2) Py_TPFLAGS_XXX values. Do you like the following fix? IOW, I check if the value is #define'd, if not I #define it to 0 (zero):
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index 6477fb2..3ae8a0c 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -59,13 +59,16 @@ #define __Pyx_DefaultClassType PyType_Type #endif
-#if PY_MAJOR_VERSION >= 3 +#if !defined(Py_TPFLAGS_CHECKTYPES) #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#if !defined(Py_TPFLAGS_HAVE_INDEX) #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if !defined(Py_TPFLAGS_HAVE_NEWBUFFER) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif - -#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) +#if !defined(Py_TPFLAGS_HAVE_FINALIZE) #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif
LGTM. I tend to use the shorter "#ifndef" instead of "#if !defined()", though. Stefan
On 18 March 2015 at 17:07, Stefan Behnel <stefan_ml@behnel.de> wrote:
LGTM. I tend to use the shorter "#ifndef" instead of "#if !defined()", though.
Do you want me to change it in master? No problem, just ask for it. -- Lisandro Dalcin ============ Research Scientist Computer, Electrical and Mathematical Sciences & Engineering (CEMSE) Numerical Porous Media Center (NumPor) King Abdullah University of Science and Technology (KAUST) http://numpor.kaust.edu.sa/ 4700 King Abdullah University of Science and Technology al-Khawarizmi Bldg (Bldg 1), Office # 4332 Thuwal 23955-6900, Kingdom of Saudi Arabia http://www.kaust.edu.sa Office Phone: +966 12 808-0459
On Thu, Mar 19, 2015 at 8:13 AM, Lisandro Dalcin <dalcinl@gmail.com> wrote:
On 18 March 2015 at 17:07, Stefan Behnel <stefan_ml@behnel.de> wrote:
LGTM. I tend to use the shorter "#ifndef" instead of "#if !defined()", though.
Do you want me to change it in master? No problem, just ask for it.
Go for it.
participants (3)
-
Lisandro Dalcin -
Robert Bradshaw -
Stefan Behnel