diff options
Diffstat (limited to 'ivycpy.i')
-rw-r--r-- | ivycpy.i | 42 |
1 files changed, 33 insertions, 9 deletions
@@ -774,31 +774,55 @@ pyIvyInit( // SWIG typemap allowing us to grab a Python callable object // ------------------------------------------------------------------- +/* %typemap(python,in) PyObject *PyFunc { */ +/* if (!PyCallable_Check($source)) { */ +/* PyErr_SetString(PyExc_TypeError, "Need a callable object!"); */ +/* return NULL; */ +/* } */ +/* $target = $source; */ +/* } */ + +/* %typemap(python,in) PyObject *PyFuncOnCx { */ +/* if (!PyCallable_Check($source)) { */ +/* PyErr_SetString(PyExc_TypeError, "Need a callable object!"); */ +/* return NULL; */ +/* } */ +/* $target = $source; */ +/* } */ + +/* %typemap(python,in) PyObject *PyFuncOnDie { */ +/* if (!PyCallable_Check($source)) { */ +/* PyErr_SetString(PyExc_TypeError, "Need a callable object!"); */ +/* return NULL; */ +/* } */ +/* $target = $source; */ +/* } */ + +// nouvelle syntaxe SWIG 1.3.x : $target -> $1 et $source -> $input %typemap(python,in) PyObject *PyFunc { - if (!PyCallable_Check($source)) { + if (!PyCallable_Check($input)) { PyErr_SetString(PyExc_TypeError, "Need a callable object!"); return NULL; } - $target = $source; -} + $1 = $input; +} %typemap(python,in) PyObject *PyFuncOnCx { - if (!PyCallable_Check($source)) { + if (!PyCallable_Check($input)) { PyErr_SetString(PyExc_TypeError, "Need a callable object!"); return NULL; } - $target = $source; -} + $1 = $input; +} %typemap(python,in) PyObject *PyFuncOnDie { - if (!PyCallable_Check($source)) { + if (!PyCallable_Check($input)) { PyErr_SetString(PyExc_TypeError, "Need a callable object!"); return NULL; } - $target = $source; + $1 = $input; } - // part 3 // on place ici les donnees, fonctions a wrapper |