reduce overhead in __pyx_PyFloat_AsDouble() when not compiling in CPython
authorStefan Behnel <stefan_ml@behnel.de>
Tue, 3 Jul 2012 20:26:16 +0000 (22:26 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Tue, 3 Jul 2012 20:26:16 +0000 (22:26 +0200)
Cython/Compiler/PyrexTypes.py

index 4698476..f5f1f34 100755 (executable)
@@ -3798,7 +3798,11 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
+#if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
 """ + type_conversion_predeclarations