summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2018-03-04 15:45:09 +0800
committerRussell Keith-Magee <russell@keith-magee.com>2018-03-04 15:45:09 +0800
commit13b3b3e9a1e920cf343db52b769624c241dbbe92 (patch)
tree73fa99602c810ada2a4dfb9e033c320b6621fc34 /numpy/core/src
parent2d44de214d63c5fc610392d1e18fa93615b12c1a (diff)
downloadnumpy-13b3b3e9a1e920cf343db52b769624c241dbbe92.tar.gz
BLD: Add configuration to allow cross platform builds for iOS.
When building NumPy for iOS, you build on macOS, with compiler flags to target iOS or the iOS simulator. However, setup.py runs on macOS, so sys.platform == 'darwin', regardless of the platform being targetted. distutils provides an environment variable - _PYTHON_HOST_PLATFORM - to indicate when you are building for a different platform. This patches uses that variable to identify cross-platform builds and disable macOS specific features. The patch also renames an internal method in strfuncs to avoid a collision with a symbol in iOS's standard library, and includes math.h to avoid errors about undefined symbols.
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/multiarray/strfuncs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/strfuncs.c b/numpy/core/src/multiarray/strfuncs.c
index 646d15cdb..495d897b2 100644
--- a/numpy/core/src/multiarray/strfuncs.c
+++ b/numpy/core/src/multiarray/strfuncs.c
@@ -41,7 +41,7 @@ PyArray_SetStringFunction(PyObject *op, int repr)
* XXX we do this in multiple places; time for a string library?
*/
static char *
-extend(char **strp, Py_ssize_t n, Py_ssize_t *maxp)
+extend_str(char **strp, Py_ssize_t n, Py_ssize_t *maxp)
{
char *str = *strp;
Py_ssize_t new_cap;
@@ -71,7 +71,7 @@ dump_data(char **string, Py_ssize_t *n, Py_ssize_t *max_n, char *data, int nd,
npy_intp i, N, ret = 0;
#define CHECK_MEMORY do { \
- if (extend(string, *n, max_n) == NULL) { \
+ if (extend_str(string, *n, max_n) == NULL) { \
ret = -1; \
goto end; \
} \