Skip to content

Commit 4633ef9

Browse files
committed
Fix PyArray_DTypeMeta definition when Py_LIMITED_API is disabled
1 parent 7a5844b commit 4633ef9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/npyffi/objects.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,19 @@ pub struct PyArray_DatetimeDTypeMetaData {
549549
// https://github.com/rust-lang/rust/issues/43467
550550
pub type npy_packed_static_string = c_void;
551551
pub type npy_string_allocator = c_void;
552+
553+
#[cfg(not(Py_LIMITED_API))]
554+
#[repr(C)]
555+
pub struct PyArray_DTypeMeta {
556+
pub superclass: PyHeapTypeObject,
557+
pub singleton: *mut PyArray_Descr,
558+
pub scalar_type: *mut PyTypeObject,
559+
pub flags: npy_uint64,
560+
pub dt_slots: *mut c_void,
561+
pub reserved: [*mut c_void; 3],
562+
}
563+
564+
#[cfg(Py_LIMITED_API)]
552565
pub type PyArray_DTypeMeta = PyTypeObject;
553566

554567
#[repr(C)]

0 commit comments

Comments
 (0)