Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-04-04 12:20:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-04 12:20:52 +0400
commita35a8f7a382e9f62834eaf355d448205665a07bc (patch)
tree022d6afbb70eb820678292cb7e584b88edec018f /source/gameengine/Expressions/PyObjectPlus.h
parentc31f806c99e14ef54a06ea90f0f66d4d1b2572a1 (diff)
- should fix compiling with older python versions (<2.5)
- made the isA() function accept python types as well as strings. - renamed _getattr_dict to py_getattr_dict
Diffstat (limited to 'source/gameengine/Expressions/PyObjectPlus.h')
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index 77963c092eb..f178d03e131 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -62,6 +62,7 @@
/* for pre Py 2.5 */
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
+typedef Py_ssize_t (*lenfunc)(PyObject *);
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PY_METHODCHAR char *
@@ -74,6 +75,7 @@ typedef int Py_ssize_t;
#include "descrobject.h"
+
static inline void Py_Fatal(const char *M) {
fprintf(stderr, "%s\n", M);
exit(-1);
@@ -108,7 +110,7 @@ static inline void Py_Fatal(const char *M) {
} \
\
if (strcmp(PyString_AsString(attr), "__dict__")==0) {\
- rvalue = _getattr_dict(rvalue, Methods, Attributes); \
+ rvalue = py_getattr_dict(rvalue, Methods, Attributes); \
} \
return rvalue; \
@@ -404,7 +406,7 @@ public:
}
};
-PyObject *_getattr_dict(PyObject *pydict, PyMethodDef *meth, PyAttributeDef *attrdef);
+PyObject *py_getattr_dict(PyObject *pydict, PyMethodDef *meth, PyAttributeDef *attrdef);
#endif // _adr_py_lib_h_