pyo3_ffi/
pyport.rs

1// NB libc does not define this constant on all platforms, so we hard code it
2// like CPython does.
3// https://github.com/python/cpython/blob/d8b9011702443bb57579f8834f3effe58e290dfc/Include/pyport.h#L372
4pub const INT_MAX: std::os::raw::c_int = 2147483647;
5
6pub type PY_UINT32_T = u32;
7pub type PY_UINT64_T = u64;
8
9pub type PY_INT32_T = i32;
10pub type PY_INT64_T = i64;
11
12pub type Py_uintptr_t = ::libc::uintptr_t;
13pub type Py_intptr_t = ::libc::intptr_t;
14pub type Py_ssize_t = ::libc::ssize_t;
15
16pub type Py_hash_t = Py_ssize_t;
17pub type Py_uhash_t = ::libc::size_t;
18
19pub const PY_SSIZE_T_MIN: Py_ssize_t = Py_ssize_t::MIN;
20pub const PY_SSIZE_T_MAX: Py_ssize_t = Py_ssize_t::MAX;
21
22#[cfg(target_endian = "big")]
23pub const PY_BIG_ENDIAN: usize = 1;
24#[cfg(target_endian = "big")]
25pub const PY_LITTLE_ENDIAN: usize = 0;
26
27#[cfg(target_endian = "little")]
28pub const PY_BIG_ENDIAN: usize = 0;
29#[cfg(target_endian = "little")]
30pub const PY_LITTLE_ENDIAN: usize = 1;
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here