diff options
Diffstat (limited to 'source/gameengine/Expressions/PyObjectPlus.h')
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 8784d28d502..c261012a3bc 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -49,12 +49,22 @@ // some basic python macros #define Py_NEWARGS 1 #define Py_Return { Py_INCREF(Py_None); return Py_None;} +static inline PyObject* Py_Success(bool truth) +{ + if (truth) + { + Py_INCREF(Py_True); + return Py_True; + } + Py_INCREF(Py_False); + return Py_False; +} #define Py_Error(E, M) {PyErr_SetString(E, M); return NULL;} #define Py_Try(F) {if (!(F)) return NULL;} #define Py_Assert(A,E,M) {if (!(A)) {PyErr_SetString(E, M); return NULL;}} -inline void Py_Fatal(char *M) { +static inline void Py_Fatal(char *M) { //cout << M << endl; exit(-1); }; |