8000 Merge pull request #22169 from mattip/universal2-python · numpy/numpy@50a74fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 50a74fb

Browse files
authored
Merge pull request #22169 from mattip/universal2-python
MAINT: fix defines for universal2 python builds of NumPy
2 parents d8c09c5 + 800c933 commit 50a74fb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

numpy/core/include/numpy/numpyconfig.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,21 @@
2222

2323
#undef NPY_SIZEOF_LONGDOUBLE
2424
#undef NPY_SIZEOF_COMPLEX_LONGDOUBLE
25+
#ifdef HAVE_LDOUBLE_IEEE_DOUBLE_LE
26+
#undef HAVE_LDOUBLE_IEEE_DOUBLE_LE
27+
#endif
28+
#ifdef HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
29+
#undef HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
30+
#endif
2531

2632
#if defined(__arm64__)
2733
#define NPY_SIZEOF_LONGDOUBLE 8
2834
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16
35+
#define HAVE_LDOUBLE_IEEE_DOUBLE_LE 1
2936
#elif defined(__x86_64)
3037
#define NPY_SIZEOF_LONGDOUBLE 16
3138
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
39+
#define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1
3240
#elif defined (__i386)
3341
#define NPY_SIZEOF_LONGDOUBLE 12
3442
#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 24

numpy/core/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,10 @@ def generate_config_h(ext, build_dir):
530530

531531
# Generate the config.h file from moredefs
532532
with open(target, 'w') as target_f:
533+
if sys.platform == 'darwin':
534+
target_f.write(
535+
"/* may be overridden by numpyconfig.h on darwin */\n"
536+
)
533537
for d in moredefs:
534538
if isinstance(d, str):
535539
target_f.write('#define %s\n' % (d))

0 commit comments

Comments
 (0)
0