Skip to content

Commit 7e77c5e

Browse files
authored
Merge pull request #193 from PyO3/long
Convert int64 to NPY_LONG if possible
2 parents e261cb8 + 30c4be1 commit 7e77c5e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/dtype.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ impl DataType {
132132
DataType::Int8 => NPY_TYPES::NPY_BYTE,
133133
DataType::Int16 => NPY_TYPES::NPY_SHORT,
134134
DataType::Int32 => NPY_TYPES::NPY_INT,
135+
#[cfg(all(target_pointer_width = "64", not(windows)))]
136+
DataType::Int64 => NPY_TYPES::NPY_LONG,
137+
#[cfg(any(target_pointer_width = "32", windows))]
135138
DataType::Int64 => NPY_TYPES::NPY_LONGLONG,
136139
DataType::Uint8 => NPY_TYPES::NPY_UBYTE,
137140
DataType::Uint16 => NPY_TYPES::NPY_USHORT,

0 commit comments

Comments
 (0)