diff options
Diffstat (limited to 'plugins/pychrysalide/helpers.h')
-rw-r--r-- | plugins/pychrysalide/helpers.h | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/plugins/pychrysalide/helpers.h b/plugins/pychrysalide/helpers.h index 348c110..c9cc098 100644 --- a/plugins/pychrysalide/helpers.h +++ b/plugins/pychrysalide/helpers.h @@ -87,26 +87,21 @@ bool register_python_module_object(PyObject *, PyTypeObject *); #name "(" args ")\n--\n\n" doc \ } -#define PYTHON_VOID_WRAPPER_DEF(name, args, flags, doc) \ - { \ - #name, (PyCFunction)py_return_none, \ - flags, \ - #name "(" args ")\n--\n\n" doc \ +#define PYTHON_WRAPPER_DEF_WITH(name, args, flags, defcb, doc) \ + { \ + #name, (PyCFunction)defcb, \ + flags, \ + #name "(" args ")\n--\n\n" doc \ } -#define PYTHON_FALSE_WRAPPER_DEF(name, args, flags, doc)\ - { \ - #name, (PyCFunction)py_return_false, \ - flags, \ - #name "(" args ")\n--\n\n" doc \ - } +#define PYTHON_VOID_WRAPPER_DEF(name, args, flags, doc) \ + PYTHON_WRAPPER_DEF_WITH(name, args, flags, py_return_none, doc) -#define PYTHON_TRUE_WRAPPER_DEF(name, args, flags, doc)\ - { \ - #name, (PyCFunction)py_return_true, \ - flags, \ - #name "(" args ")\n--\n\n" doc \ - } +#define PYTHON_FALSE_WRAPPER_DEF(name, args, flags, doc) \ + PYTHON_WRAPPER_DEF_WITH(name, args, flags, py_return_false, doc) + +#define PYTHON_TRUE_WRAPPER_DEF(name, args, flags, doc) \ + PYTHON_WRAPPER_DEF_WITH(name, args, flags, py_return_true, doc) /** * Il ne semble pas exister de moyen de déterminer |