Author: Matti Picus <[email protected]>
Branch: 
Changeset: r85370:a0105e0d00db
Date: 2016-06-24 16:24 +0300
http://bitbucket.org/pypy/pypy/changeset/a0105e0d00db/

Log:    refactor _import_array to be more like upstream (used on pypy/numpy)

diff --git a/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h 
b/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h
--- a/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h
+++ b/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h
@@ -5,7 +5,12 @@
         npy_bool obval;
 } PyBoolScalarObject;
 
-static int import_array(){return 0;};
-static int _import_array(){return 0;};
-static int _import_math(){return 0;};
+#if PY_VERSION_HEX >= 0x03000000
+#define NUMPY_IMPORT_ARRAY_RETVAL NULL
+#else
+#define NUMPY_IMPORT_ARRAY_RETVAL
+#endif
 
+#define import_array() {return NUMPY_IMPORT_ARRAY_RETVAL;}
+
+
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to