|
|
@@ -252,143 +252,12 @@ struct Dtool_PyTypedObject {
|
|
|
Dtool_InitNoCoerce_##CLASS_NAME \
|
|
|
};
|
|
|
|
|
|
-#if PY_MAJOR_VERSION >= 3
|
|
|
-#define Define_Dtool_Class(MODULE_NAME, CLASS_NAME, PUBLIC_NAME) \
|
|
|
- static PyNumberMethods Dtool_PyNumberMethods_##CLASS_NAME = \
|
|
|
- { \
|
|
|
- 0,/*binaryfunc nb_add*/ \
|
|
|
- 0,/*binaryfunc nb_subtract*/ \
|
|
|
- 0,/*binaryfunc nb_multiply*/ \
|
|
|
- 0,/*binaryfunc nb_remainder*/ \
|
|
|
- 0,/*binaryfunc nb_divmod*/ \
|
|
|
- 0,/*ternaryfunc nb_power*/ \
|
|
|
- 0,/*unaryfunc nb_negative*/ \
|
|
|
- 0,/*unaryfunc nb_positive*/ \
|
|
|
- 0,/*unaryfunc nb_absolute*/ \
|
|
|
- 0,/*inquiry nb_bool*/ \
|
|
|
- 0,/*unaryfunc nb_invert*/ \
|
|
|
- 0,/*binaryfunc nb_lshift*/ \
|
|
|
- 0,/*binaryfunc nb_rshift*/ \
|
|
|
- 0,/*binaryfunc nb_and*/ \
|
|
|
- 0,/*binaryfunc nb_xor*/ \
|
|
|
- 0,/*binaryfunc nb_or*/ \
|
|
|
- 0,/*unaryfunc nb_int*/ \
|
|
|
- 0,/*void *nb_reserved*/ \
|
|
|
- 0,/*unaryfunc nb_float*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_add*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_subtract*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_multiply*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_remainder*/ \
|
|
|
- 0,/*ternaryfunc nb_inplace_power*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_lshift*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_rshift*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_and*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_xor*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_or*/ \
|
|
|
- 0,/*binaryfunc nb_floor_divide*/ \
|
|
|
- 0,/*binaryfunc nb_true_divide*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_floor_divide*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_true_divide*/ \
|
|
|
- 0,/*unaryfunc nb_index*/ \
|
|
|
- }; \
|
|
|
- static PySequenceMethods Dtool_PySequenceMethods_##CLASS_NAME = \
|
|
|
- { \
|
|
|
- 0,/*lenfunc sq_length */ \
|
|
|
- 0,/*binaryfunc sq_concat */ \
|
|
|
- 0,/*ssizeargfunc sq_repeat */ \
|
|
|
- 0,/*ssizeargfunc sq_item */ \
|
|
|
- 0,/*void *was_sq_slice */ \
|
|
|
- 0,/*ssizeargfunc sq_ass_item */ \
|
|
|
- 0,/*void *was_sq_ass_slice */ \
|
|
|
- 0,/*objobjproc sq_contains */ \
|
|
|
- 0,/*binaryfunc sq_inplace_concat */ \
|
|
|
- 0,/*ssizeargfunc sq_inplace_repeat */ \
|
|
|
- }; \
|
|
|
- static PyMappingMethods Dtool_PyMappingMethods_##CLASS_NAME = \
|
|
|
- { \
|
|
|
- 0,/*inquiry mp_length */ \
|
|
|
- 0,/*binaryfunc mp_subscript */ \
|
|
|
- 0,/*objobjargproc mp_ass_subscript */ \
|
|
|
- }; \
|
|
|
- static PyMappingMethods Dtool_PyBufferProcs_##CLASS_NAME = \
|
|
|
- { \
|
|
|
- 0,/*getbufferproc bf_getbuffer */ \
|
|
|
- 0,/*releasebufferproc bf_releasebuffer */ \
|
|
|
- }; \
|
|
|
- Define_Dtool_PyTypedObject(MODULE_NAME, CLASS_NAME, PUBLIC_NAME)
|
|
|
-
|
|
|
-#else // Python 2:
|
|
|
-
|
|
|
#define Define_Dtool_Class(MODULE_NAME, CLASS_NAME, PUBLIC_NAME) \
|
|
|
- static PyNumberMethods Dtool_PyNumberMethods_##CLASS_NAME = \
|
|
|
- { \
|
|
|
- 0,/*binaryfunc nb_add*/ \
|
|
|
- 0,/*binaryfunc nb_subtract*/ \
|
|
|
- 0,/*binaryfunc nb_multiply*/ \
|
|
|
- 0,/*binaryfunc nb_divide*/ \
|
|
|
- 0,/*binaryfunc nb_remainder*/ \
|
|
|
- 0,/*binaryfunc nb_divmod*/ \
|
|
|
- 0,/*ternaryfunc nb_power*/ \
|
|
|
- 0,/*unaryfunc nb_negative*/ \
|
|
|
- 0,/*unaryfunc nb_positive*/ \
|
|
|
- 0,/*unaryfunc nb_absolute*/ \
|
|
|
- 0,/*inquiry nb_nonzero*/ \
|
|
|
- 0,/*unaryfunc nb_invert*/ \
|
|
|
- 0,/*binaryfunc nb_lshift*/ \
|
|
|
- 0,/*binaryfunc nb_rshift*/ \
|
|
|
- 0,/*binaryfunc nb_and*/ \
|
|
|
- 0,/*binaryfunc nb_xor*/ \
|
|
|
- 0,/*binaryfunc nb_or*/ \
|
|
|
- 0,/*coercion nb_coerce*/ \
|
|
|
- 0,/*unaryfunc nb_int*/ \
|
|
|
- 0,/*unaryfunc nb_long*/ \
|
|
|
- 0,/*unaryfunc nb_float*/ \
|
|
|
- 0,/*unaryfunc nb_oct*/ \
|
|
|
- 0,/*unaryfunc nb_hex*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_add*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_subtract*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_multiply*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_divide*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_remainder*/ \
|
|
|
- 0,/*ternaryfunc nb_inplace_power*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_lshift*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_rshift*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_and*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_xor*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_or*/ \
|
|
|
- 0,/*binaryfunc nb_floor_divide*/ \
|
|
|
- 0,/*binaryfunc nb_true_divide*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_floor_divide*/ \
|
|
|
- 0,/*binaryfunc nb_inplace_true_divide*/ \
|
|
|
- }; \
|
|
|
- static PySequenceMethods Dtool_PySequenceMethods_##CLASS_NAME = \
|
|
|
- { \
|
|
|
- 0,/*lenfunc sq_length */ \
|
|
|
- 0,/*binaryfunc sq_concat */ \
|
|
|
- 0,/*ssizeargfunc sq_repeat */ \
|
|
|
- 0,/*ssizeargfunc sq_item */ \
|
|
|
- 0,/*ssizeargfunc sq_ass_item */ \
|
|
|
- 0,/*objobjproc sq_contains */ \
|
|
|
- 0,/*binaryfunc sq_inplace_concat */ \
|
|
|
- 0,/*ssizeargfunc sq_inplace_repeat */ \
|
|
|
- }; \
|
|
|
- static PyMappingMethods Dtool_PyMappingMethods_##CLASS_NAME = \
|
|
|
- { \
|
|
|
- 0,/*inquiry mp_length */ \
|
|
|
- 0,/*binaryfunc mp_subscript */ \
|
|
|
- 0,/*objobjargproc mp_ass_subscript */ \
|
|
|
- }; \
|
|
|
- static PyBufferProcs Dtool_PyBufferProcs_##CLASS_NAME = \
|
|
|
- { \
|
|
|
- 0,/*readbufferproc bf_getreadbuffer */ \
|
|
|
- 0,/*writebufferproc bf_getwritebuffer */ \
|
|
|
- 0,/*segcountproc bf_getsegcount */ \
|
|
|
- 0,/*charbufferproc bf_getcharbuffer */ \
|
|
|
- 0,/*getbufferproc bf_getbuffer */ \
|
|
|
- 0,/*releasebufferproc bf_releasebuffer */ \
|
|
|
- }; \
|
|
|
+ static PyNumberMethods Dtool_PyNumberMethods_##CLASS_NAME = {0}; \
|
|
|
+ static PySequenceMethods Dtool_PySequenceMethods_##CLASS_NAME = {0}; \
|
|
|
+ static PyMappingMethods Dtool_PyMappingMethods_##CLASS_NAME = {0}; \
|
|
|
+ static PyBufferProcs Dtool_PyBufferProcs_##CLASS_NAME = {0}; \
|
|
|
Define_Dtool_PyTypedObject(MODULE_NAME, CLASS_NAME, PUBLIC_NAME)
|
|
|
-#endif
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
// The Fast Deallocator.. for Our instances..
|