diff options
-rw-r--r-- | numpy/core/include/numpy/ndarraytypes.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h index af705b936..94c45df88 100644 --- a/numpy/core/include/numpy/ndarraytypes.h +++ b/numpy/core/include/numpy/ndarraytypes.h @@ -1377,10 +1377,14 @@ PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v) arr); } +/* Same as PyArray_DATA */ +#define PyArray_BYTES(arr) PyArray_DATA(arr) + #else /* Macros are deprecated as of NumPy 1.7. */ #define PyArray_NDIM(obj) (((PyArrayObject_fieldaccess *)(obj))->nd) +#define PyArray_BYTES(obj) ((char *)(((PyArrayObject_fieldaccess *)(obj))->data)) #define PyArray_DATA(obj) ((void *)(((PyArrayObject_fieldaccess *)(obj))->data)) #define PyArray_DIMS(obj) (((PyArrayObject_fieldaccess *)(obj))->dimensions) #define PyArray_STRIDES(obj) (((PyArrayObject_fieldaccess *)(obj))->strides) @@ -1405,9 +1409,6 @@ PyArray_SETITEM(PyArrayObject *arr, char *itemptr, PyObject *v) (PyArrayObject *)(obj)) #endif -/* Same as PyArray_DATA */ -#define PyArray_BYTES(arr) PyArray_DATA(arr) - /* * Enables the specified array flags. Does no checking, * assumes you know what you're doing. |