Replace BLI_INLINE w/ Py_LOCAL_INLINE for Python
Recent inclusion caused build error with the BGE.
This commit is contained in:
@@ -24,7 +24,6 @@
|
|||||||
* \ingroup pygen
|
* \ingroup pygen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef __PY_CAPI_UTILS_H__
|
#ifndef __PY_CAPI_UTILS_H__
|
||||||
#define __PY_CAPI_UTILS_H__
|
#define __PY_CAPI_UTILS_H__
|
||||||
|
|
||||||
@@ -103,8 +102,8 @@ uint64_t PyC_Long_AsU64(PyObject *value);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* inline so type signatures match as expected */
|
/* inline so type signatures match as expected */
|
||||||
BLI_INLINE int32_t PyC_Long_AsI32(PyObject *value) { return (int32_t)_PyLong_AsInt(value); }
|
Py_LOCAL_INLINE(int32_t) PyC_Long_AsI32(PyObject *value) { return (int32_t)_PyLong_AsInt(value); }
|
||||||
BLI_INLINE int64_t PyC_Long_AsI64(PyObject *value) { return (int64_t)PyLong_AsLongLong(value); }
|
Py_LOCAL_INLINE(int64_t) PyC_Long_AsI64(PyObject *value) { return (int64_t)PyLong_AsLongLong(value); }
|
||||||
BLI_INLINE uint64_t PyC_Long_AsU64(PyObject *value) { return (uint64_t)PyLong_AsUnsignedLongLong(value); }
|
Py_LOCAL_INLINE(uint64_t) PyC_Long_AsU64(PyObject *value) { return (uint64_t)PyLong_AsUnsignedLongLong(value); }
|
||||||
|
|
||||||
#endif /* __PY_CAPI_UTILS_H__ */
|
#endif /* __PY_CAPI_UTILS_H__ */
|
||||||
|
@@ -42,10 +42,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* wrap Py_INCREF & return the result,
|
/* wrap Py_INCREF & return the result,
|
||||||
* use sparingly to avoid comma operator or temp var assignment */
|
* use sparingly to avoid comma operator or temp var assignment */
|
||||||
BLI_INLINE PyObject *Py_INCREF_RET(PyObject *op) { Py_INCREF(op); return op; }
|
Py_LOCAL_INLINE(PyObject *)Py_INCREF_RET(PyObject *op) { Py_INCREF(op); return op; }
|
||||||
|
|
||||||
/* append & transfer ownership to the list, avoids inline Py_DECREF all over (which is quite a large macro) */
|
/* append & transfer ownership to the list, avoids inline Py_DECREF all over (which is quite a large macro) */
|
||||||
BLI_INLINE int PyList_APPEND(PyObject *op, PyObject *v)
|
Py_LOCAL_INLINE(int) PyList_APPEND(PyObject *op, PyObject *v)
|
||||||
{
|
{
|
||||||
int ret = PyList_Append(op, v);
|
int ret = PyList_Append(op, v);
|
||||||
Py_DecRef(v);
|
Py_DecRef(v);
|
||||||
|
Reference in New Issue
Block a user