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-06-28 17:27:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-06-28 17:27:06 +0400
commit1b5851b4f963f32890ea7479ba410844bb906b5e (patch)
tree776927ba4784792f39641b54dfe62c08a0e19082 /source/blender/python/generic/matrix.c
parent7d88981a24e16c9ddd5d882183d9421e7ce90d23 (diff)
PyNumberMethods needed ifdefs for python3.x and some other corrections.
Diffstat (limited to 'source/blender/python/generic/matrix.c')
-rw-r--r--source/blender/python/generic/matrix.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c
index b546aa1226c..311a14fbb0a 100644
--- a/source/blender/python/generic/matrix.c
+++ b/source/blender/python/generic/matrix.c
@@ -1012,6 +1012,46 @@ static PySequenceMethods Matrix_SeqMethods = {
(ssizeobjargproc) Matrix_ass_item, /* sq_ass_item */
(ssizessizeobjargproc) Matrix_ass_slice, /* sq_ass_slice */
};
+
+
+#if (PY_VERSION_HEX >= 0x03000000)
+static PyNumberMethods Matrix_NumMethods = {
+ (binaryfunc) Matrix_add, /*nb_add*/
+ (binaryfunc) Matrix_sub, /*nb_subtract*/
+ (binaryfunc) Matrix_mul, /*nb_multiply*/
+ 0, /*nb_remainder*/
+ 0, /*nb_divmod*/
+ 0, /*nb_power*/
+ (unaryfunc) 0, /*nb_negative*/
+ (unaryfunc) 0, /*tp_positive*/
+ (unaryfunc) 0, /*tp_absolute*/
+ (inquiry) 0, /*tp_bool*/
+ (unaryfunc) Matrix_inv, /*nb_invert*/
+ 0, /*nb_lshift*/
+ (binaryfunc)0, /*nb_rshift*/
+ 0, /*nb_and*/
+ 0, /*nb_xor*/
+ 0, /*nb_or*/
+ 0, /*nb_int*/
+ 0, /*nb_reserved*/
+ 0, /*nb_float*/
+ 0, /* nb_inplace_add */
+ 0, /* nb_inplace_subtract */
+ 0, /* nb_inplace_multiply */
+ 0, /* nb_inplace_remainder */
+ 0, /* nb_inplace_power */
+ 0, /* nb_inplace_lshift */
+ 0, /* nb_inplace_rshift */
+ 0, /* nb_inplace_and */
+ 0, /* nb_inplace_xor */
+ 0, /* nb_inplace_or */
+ 0, /* nb_floor_divide */
+ 0, /* nb_true_divide */
+ 0, /* nb_inplace_floor_divide */
+ 0, /* nb_inplace_true_divide */
+ 0, /* nb_index */
+};
+#else
static PyNumberMethods Matrix_NumMethods = {
(binaryfunc) Matrix_add, /* __add__ */
(binaryfunc) Matrix_sub, /* __sub__ */
@@ -1037,6 +1077,7 @@ static PyNumberMethods Matrix_NumMethods = {
(unaryfunc) 0, /* __oct__ */
(unaryfunc) 0, /* __hex__ */
};
+#endif
static PyObject *Matrix_getRowSize( MatrixObject * self, void *type )
{