|
1 | 1 | #ifndef NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_ |
2 | 2 | #define NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_ |
3 | 3 |
|
| 4 | +#ifndef Py_TARGET_ABI3T |
4 | 5 | #ifndef _MULTIARRAYMODULE |
5 | 6 | typedef struct { |
6 | 7 | PyObject_HEAD |
@@ -134,7 +135,7 @@ typedef struct { |
134 | 135 | char obval; |
135 | 136 | } PyScalarObject; |
136 | 137 |
|
137 | | -#define PyStringScalarObject PyBytesObject |
| 138 | + |
138 | 139 | #ifndef Py_LIMITED_API |
139 | 140 | typedef struct { |
140 | 141 | /* note that the PyObject_HEAD macro lives right here */ |
@@ -162,6 +163,34 @@ typedef struct { |
162 | 163 | void *_buffer_info; /* private buffer info, tagged to allow warning */ |
163 | 164 | #endif |
164 | 165 | } PyVoidScalarObject; |
| 166 | +#else |
| 167 | +typedef struct PyBoolScalarObject PyBoolScalarObject; |
| 168 | +typedef struct PyByteScalarObject PyByteScalarObject; |
| 169 | +typedef struct PyShortScalarObject PyShortScalarObject; |
| 170 | +typedef struct PyIntScalarObject PyIntScalarObject; |
| 171 | +typedef struct PyLongScalarObject PyLongScalarObject; |
| 172 | +typedef struct PyLongLongScalarObject PyLongLongScalarObject; |
| 173 | +typedef struct PyUByteScalarObject PyUByteScalarObject; |
| 174 | +typedef struct PyUShortScalarObject PyUShortScalarObject; |
| 175 | +typedef struct PyUIntScalarObject PyUIntScalarObject; |
| 176 | +typedef struct PyULongScalarObject PyULongScalarObject; |
| 177 | +typedef struct PyULongLongScalarObject PyULongLongScalarObject; |
| 178 | +typedef struct PyHalfScalarObject PyHalfScalarObject; |
| 179 | +typedef struct PyFloatScalarObject PyFloatScalarObject; |
| 180 | +typedef struct PyDoubleScalarObject PyDoubleScalarObject; |
| 181 | +typedef struct PyLongDoubleScalarObject PyLongDoubleScalarObject; |
| 182 | +typedef struct PyCFloatScalarObject PyCFloatScalarObject; |
| 183 | +typedef struct PyCDoubleScalarObject PyCDoubleScalarObject; |
| 184 | +typedef struct PyCLongDoubleScalarObject PyCLongDoubleScalarObject; |
| 185 | +typedef struct PyObjectScalarObject PyObjectScalarObject; |
| 186 | +typedef struct PyDatetimeScalarObject PyDatetimeScalarObject; |
| 187 | +typedef struct PyTimedeltaScalarObject PyTimedeltaScalarObject; |
| 188 | +typedef struct PyScalarObject PyScalarObject; |
| 189 | +typedef struct PyVoidScalarObject PyVoidScalarObject; |
| 190 | +#endif |
| 191 | + |
| 192 | + |
| 193 | + |
165 | 194 |
|
166 | 195 | /* Macros |
167 | 196 | Py<Cls><bitsize>ScalarObject |
@@ -193,6 +222,7 @@ typedef struct { |
193 | 222 | ((Py##cls##ScalarObject *)obj)->obval |
194 | 223 | #define PyArrayScalar_ASSIGN(obj, cls, val) \ |
195 | 224 | PyArrayScalar_VAL(obj, cls) = val |
| 225 | +#define PyStringScalarObject PyBytesObject |
196 | 226 | #endif |
197 | 227 |
|
198 | 228 | #endif /* NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_ */ |
0 commit comments