Skip to content

Commit b839fa9

Browse files
committed
Fix compat issue
1 parent fe0f7fc commit b839fa9

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

pyfastutil/src/Compat.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
#include "stdbool.h"
2727
#endif
2828

29+
#if PY_VERSION_HEX >= 0x030D0000 // 3.13
30+
#define IS_PYTHON_313_OR_LATER
31+
#endif
32+
2933
#if PY_VERSION_HEX >= 0x030C0000 // 3.12
3034
#define IS_PYTHON_312_OR_LATER
3135
#endif

pyfastutil/src/utils/PythonUtils.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ static __forceinline bool PyParse_EvalRange(PyObject *&args, Py_ssize_t &start,
8080
#endif
8181

8282
static __forceinline int PyFast_AsInt(PyObject *obj) noexcept {
83-
#ifdef IS_PYTHON_312_OR_LATER
83+
#ifdef IS_PYTHON_313_OR_LATER
84+
return PyLong_AsInt(obj);
85+
#elifdef IS_PYTHON_312_OR_LATER
8486
return _PyLong_AsInt(obj);
8587
#else
8688
const Py_ssize_t size = Py_SIZE(obj);

pyfastutil/src/utils/include/qreverse.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ inline void qReverse<2>(void *Array, std::size_t Count) {
538538
// 8 elements at a time
539539
i += 8;
540540
}
541+
}
541542
#endif
542543

543544
// Naive swaps

0 commit comments

Comments
 (0)