Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aa89843

Browse filesBrowse files
committed
MAINT: Move modref definition into setup.py
It seems the only reason this did not cause problems before was that the test checking for C warnings only ran on a run where these were always 0 and thus undefined (and so were not redefined later). The `#ifndef` would have to happen at a later time apparently, so just avoid it.
1 parent 73fe877 commit aa89843
Copy full SHA for aa89843

File tree

Expand file treeCollapse file tree

2 files changed

+6
-10
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-10
lines changed

‎numpy/core/include/numpy/npy_common.h

Copy file name to clipboardExpand all lines: numpy/core/include/numpy/npy_common.h
-10Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
#include <npy_config.h>
1111
#endif
1212

13-
// compile time environment variables
14-
#ifndef NPY_RELAXED_STRIDES_CHECKING
15-
#define NPY_RELAXED_STRIDES_CHECKING 0
16-
#endif
17-
#ifndef NPY_RELAXED_STRIDES_DEBUG
18-
#define NPY_RELAXED_STRIDES_DEBUG 0
19-
#endif
20-
#ifndef NPY_USE_NEW_CASTINGIMPL
21-
#define NPY_USE_NEW_CASTINGIMPL 0
22-
#endif
2313
/*
2414
* using static inline modifiers when defining npy_math functions
2515
* allows the compiler to make optimizations when possible

‎numpy/core/setup.py

Copy file name to clipboardExpand all lines: numpy/core/setup.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,14 +468,20 @@ def generate_config_h(ext, build_dir):
468468
# Use relaxed stride checking
469469
if NPY_RELAXED_STRIDES_CHECKING:
470470
moredefs.append(('NPY_RELAXED_STRIDES_CHECKING', 1))
471+
else:
472+
moredefs.append(('NPY_RELAXED_STRIDES_CHECKING', 0))
471473

472474
# Use bogus stride debug aid when relaxed strides are enabled
473475
if NPY_RELAXED_STRIDES_DEBUG:
474476
moredefs.append(('NPY_RELAXED_STRIDES_DEBUG', 1))
477+
else:
478+
moredefs.append(('NPY_RELAXED_STRIDES_DEBUG', 0))
475479

476480
# Use the new experimental casting implementation in NumPy 1.20:
477481
if NPY_USE_NEW_CASTINGIMPL:
478482
moredefs.append(('NPY_USE_NEW_CASTINGIMPL', 1))
483+
else:
484+
moredefs.append(('NPY_USE_NEW_CASTINGIMPL', 0))
479485

480486
# Get long double representation
481487
rep = check_long_double_representation(config_cmd)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.