Skip to content

Commit b3466b5

Browse files
committed
fix: add Py_ALWAYS_INLINE fallback for Python < 3.12
Py_ALWAYS_INLINE was added in Python 3.12. On older versions (3.9-3.11) it is not defined, causing a compile error.
1 parent aaee11d commit b3466b5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/_xxhash.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
* On success, *owner is set to the object that owns the buffer
5050
* (NULL if the arg itself supports the buffer protocol).
5151
* Caller must PyBuffer_Release(buf) and Py_XDECREF(*owner). */
52+
#ifndef Py_ALWAYS_INLINE
53+
# define Py_ALWAYS_INLINE
54+
#endif
55+
5256
static Py_ALWAYS_INLINE int
5357
_get_buffer_or_str(PyObject *obj, Py_buffer *buf, PyObject **owner)
5458
{

0 commit comments

Comments
 (0)