diff options
| author | Sebastian Berg <sebastianb@nvidia.com> | 2023-04-06 17:43:37 +0200 |
|---|---|---|
| committer | Sebastian Berg <sebastianb@nvidia.com> | 2023-04-06 17:43:37 +0200 |
| commit | 66ccd52bb19093be6725a3fc672feeaf727ac299 (patch) | |
| tree | 85b15e4bcfa2919700051400e08d3b44c68ea619 /numpy/core/include | |
| parent | eeb8153a251675f90636fa09b9ae17044b5dc7f2 (diff) | |
| download | numpy-66ccd52bb19093be6725a3fc672feeaf727ac299.tar.gz | |
Tweak to just warn for low versions
Diffstat (limited to 'numpy/core/include')
| -rw-r--r-- | numpy/core/include/numpy/numpyconfig.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/numpy/core/include/numpy/numpyconfig.h b/numpy/core/include/numpy/numpyconfig.h index 3137d1a2d..457947bca 100644 --- a/numpy/core/include/numpy/numpyconfig.h +++ b/numpy/core/include/numpy/numpyconfig.h @@ -115,23 +115,23 @@ * 1.17 as default was the choice of oldest-support-numpy at the time and * has in practice no limit (comapared to 1.19). Even earlier becomes legacy. */ -#ifdef NPY_TARGET_VERSION - #define NPY_FEATURE_VERSION NPY_TARGET_VERSION -#else - #if defined(NPY_INTERNAL_BUILD) && NPY_INTERNAL_BUILD +#if defined(NPY_INTERNAL_BUILD) && NPY_INTERNAL_BUILD + /* NumPy internal build, always use current version. */ #define NPY_FEATURE_VERSION NPY_API_VERSION - #else - /* NOTE: This default should be increased over time: */ +#elif defined(NPY_TARGET_VERSION) && NPY_TARGET_VERSION + /* user provided a target version, use it */ + #define NPY_FEATURE_VERSION NPY_TARGET_VERSION +#else + /* Use the default (should be increased over time) */ #define NPY_FEATURE_VERSION NPY_1_17_API_VERSION - #endif #endif /* Sanity check the (requested) feature version */ #if NPY_FEATURE_VERSION > NPY_API_VERSION #error "NPY_TARGET_VERSION higher than NumPy headers!" #elif NPY_FEATURE_VERSION < NPY_1_15_API_VERSION - /* Older than NumPy 1.15 requires Python 3.6... */ - #error "NPY_TARGET_VERSION cannot ask for a version before 1.15." + /* No support for irrelevant old targets, no need for error, but warn. */ + #warning "Requested NumPy target lower than supported NumPy 1.15." #endif |
