diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-05-07 09:23:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-05-07 09:23:15 +0400 |
commit | 779bf435ef2ba87fbcee6a28b053d97a551b8eb5 (patch) | |
tree | 484cf248d2cce408dc9e90d989a003534035c818 /source/gameengine/Expressions | |
parent | c46fa2745a98fe0b4545743751ad1e96802e330d (diff) |
python3 compatibility for the BGE api, this only works with scons when WITH_BF_NOBLENDER is enabled.
Mathutils, Geometry and BGL modules are currently disabled with python3
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 449ece535c1..c21dc3a6e57 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -43,6 +43,23 @@ * Python defines ------------------------------*/ + + +#if PY_VERSION_HEX > 0x03000000 +#define PyString_FromString PyUnicode_FromString +#define PyString_FromFormat PyUnicode_FromFormat +#define PyString_Check PyUnicode_Check +#define PyString_Size PyUnicode_GetSize + +#define PyInt_FromLong PyLong_FromSsize_t +#define PyInt_AsLong PyLong_AsSsize_t +#define PyString_AsString _PyUnicode_AsString +#define PyInt_Check PyLong_Check +#define PyInt_AS_LONG PyLong_AsLong // TODO - check this one +#endif + + + /* Py_RETURN_NONE Python 2.4 macro. |