Skip to main content

numpy/npyffi/
numpyconfig.rs

1// This file matches the numpyconfig.h header.
2
3use std::ffi::c_uint;
4
5/// The current target ABI version
6const NPY_ABI_VERSION: c_uint = 0x02000000;
7
8/// The current target API version
9const NPY_API_VERSION: c_uint = if cfg!(all(Py_LIMITED_API, Py_GIL_DISABLED)) {
10    // (v2.5)
11    0x00000016
12} else {
13    // (v1.15)
14    0x0000000c
15};
16
17pub(super) const NPY_2_0_API_VERSION: c_uint = 0x00000012;
18
19/// The current version of the `ndarray` object (ABI version).
20pub const NPY_VERSION: c_uint = NPY_ABI_VERSION;
21/// The current version of C API.
22pub const NPY_FEATURE_VERSION: c_uint = NPY_API_VERSION;
23/// The string representation of current version C API.
24pub const NPY_FEATURE_VERSION_STRING: &str = if cfg!(all(Py_LIMITED_API, Py_GIL_DISABLED)) {
25    "2.5"
26} else {
27    "1.15"
28};