diff --git a/src/Base/PyObjectBase.h b/src/Base/PyObjectBase.h index 1b9ae3fc01..1ae0a52d85 100644 --- a/src/Base/PyObjectBase.h +++ b/src/Base/PyObjectBase.h @@ -84,6 +84,21 @@ */ #define PYFUNCIMP_S(CLASS,SFUNC) PyObject* CLASS::SFUNC (PyObject *self,PyObject *args,PyObject *kwd) + +/** Macro for initialization function of Python modules. + */ +#if PY_MAJOR_VERSION >= 3 +# define PyMOD_INIT_FUNC(name) PyMODINIT_FUNC PyInit_##name(void) +#else +# define PyMOD_INIT_FUNC(name) PyMODINIT_FUNC init##name(void) +#endif + +#if PY_MAJOR_VERSION >= 3 +# define PyMOD_Return(name) return name +#else +# define PyMOD_Return(name) return +#endif + /** * Union to convert from PyTypeObject to PyObject pointer. */