numpyconfig.h
1 #ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_ 2 #define NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_ 3 4 #include "_numpyconfig.h" 5 6 /* 7 * On Mac OS X, because there is only one configuration stage for all the archs 8 * in universal builds, any macro which depends on the arch needs to be 9 * hardcoded. 10 * 11 * Note that distutils/pip will attempt a universal2 build when Python itself 12 * is built as universal2, hence this hardcoding is needed even if we do not 13 * support universal2 wheels anymore (see gh-22796). 14 * This code block can be removed after we have dropped the setup.py based 15 * build completely. 16 */ 17 #ifdef __APPLE__ 18 #undef NPY_SIZEOF_LONG 19 #undef NPY_SIZEOF_PY_INTPTR_T 20 21 #ifdef __LP64__ 22 #define NPY_SIZEOF_LONG 8 23 #define NPY_SIZEOF_PY_INTPTR_T 8 24 #else 25 #define NPY_SIZEOF_LONG 4 26 #define NPY_SIZEOF_PY_INTPTR_T 4 27 #endif 28 29 #undef NPY_SIZEOF_LONGDOUBLE 30 #undef NPY_SIZEOF_COMPLEX_LONGDOUBLE 31 #ifdef HAVE_LDOUBLE_IEEE_DOUBLE_LE 32 #undef HAVE_LDOUBLE_IEEE_DOUBLE_LE 33 #endif 34 #ifdef HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 35 #undef HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 36 #endif 37 38 #if defined(__arm64__) 39 #define NPY_SIZEOF_LONGDOUBLE 8 40 #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16 41 #define HAVE_LDOUBLE_IEEE_DOUBLE_LE 1 42 #elif defined(__x86_64) 43 #define NPY_SIZEOF_LONGDOUBLE 16 44 #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 45 #define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1 46 #elif defined (__i386) 47 #define NPY_SIZEOF_LONGDOUBLE 12 48 #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 24 49 #elif defined(__ppc__) || defined (__ppc64__) 50 #define NPY_SIZEOF_LONGDOUBLE 16 51 #define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32 52 #else 53 #error "unknown architecture" 54 #endif 55 #endif 56 57 58 /** 59 * To help with the NPY_NO_DEPRECATED_API macro, we include API version 60 * numbers for specific versions of NumPy. To exclude all API that was 61 * deprecated as of 1.7, add the following before #including any NumPy 62 * headers: 63 * #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION 64 */ 65 #define NPY_1_7_API_VERSION 0x00000007 66 #define NPY_1_8_API_VERSION 0x00000008 67 #define NPY_1_9_API_VERSION 0x00000008 68 #define NPY_1_10_API_VERSION 0x00000008 69 #define NPY_1_11_API_VERSION 0x00000008 70 #define NPY_1_12_API_VERSION 0x00000008 71 #define NPY_1_13_API_VERSION 0x00000008 72 #define NPY_1_14_API_VERSION 0x00000008 73 #define NPY_1_15_API_VERSION 0x00000008 74 #define NPY_1_16_API_VERSION 0x00000008 75 #define NPY_1_17_API_VERSION 0x00000008 76 #define NPY_1_18_API_VERSION 0x00000008 77 #define NPY_1_19_API_VERSION 0x00000008 78 #define NPY_1_20_API_VERSION 0x0000000e 79 #define NPY_1_21_API_VERSION 0x0000000e 80 #define NPY_1_22_API_VERSION 0x0000000f 81 #define NPY_1_23_API_VERSION 0x00000010 82 #define NPY_1_24_API_VERSION 0x00000010 83 84 #endif /* NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_ */