[Bf-blender-cvs] [e27a59d411a] master: Replace BLI_INLINE w/ Py_LOCAL_INLINE for Python

Campbell Barton noreply at git.blender.org
Sun Aug 20 13:11:26 CEST 2017


Commit: e27a59d411a1ec69b54ee0f1d88997db086bb996
Author: Campbell Barton
Date:   Sun Aug 20 21:14:33 2017 +1000
Branches: master
https://developer.blender.org/rBe27a59d411a1ec69b54ee0f1d88997db086bb996

Replace BLI_INLINE w/ Py_LOCAL_INLINE for Python

Recent inclusion caused build error with the BGE.

===================================================================

M	source/blender/python/generic/py_capi_utils.h
M	source/blender/python/generic/python_utildefines.h

===================================================================

diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index 322e67f486d..88546719777 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -24,7 +24,6 @@
  *  \ingroup pygen
  */
 
-
 #ifndef __PY_CAPI_UTILS_H__
 #define __PY_CAPI_UTILS_H__
 
@@ -103,8 +102,8 @@ uint64_t PyC_Long_AsU64(PyObject *value);
 #endif
 
 /* inline so type signatures match as expected */
-BLI_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); }
-BLI_INLINE uint64_t PyC_Long_AsU64(PyObject *value) { return (uint64_t)PyLong_AsUnsignedLongLong(value); }
+Py_LOCAL_INLINE(int32_t)  PyC_Long_AsI32(PyObject *value) { return (int32_t)_PyLong_AsInt(value); }
+Py_LOCAL_INLINE(int64_t)  PyC_Long_AsI64(PyObject *value) { return (int64_t)PyLong_AsLongLong(value); }
+Py_LOCAL_INLINE(uint64_t) PyC_Long_AsU64(PyObject *value) { return (uint64_t)PyLong_AsUnsignedLongLong(value); }
 
 #endif  /* __PY_CAPI_UTILS_H__ */
diff --git a/source/blender/python/generic/python_utildefines.h b/source/blender/python/generic/python_utildefines.h
index f7d3e7a8b4a..a7d82586dc0 100644
--- a/source/blender/python/generic/python_utildefines.h
+++ b/source/blender/python/generic/python_utildefines.h
@@ -42,10 +42,10 @@ extern "C" {
 
 /* wrap Py_INCREF & return the result,
  * 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) */
-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);
 	Py_DecRef(v);



More information about the Bf-blender-cvs mailing list