}
%enddef
-
+// This macro can be used to disable the releasing of the GIL when calling the
+// C++ function.
+%define KeepGIL(name)
+%exception name {
+ $action
+ if (PyErr_Occurred()) SWIG_fail;
+}
+%enddef
+
//---------------------------------------------------------------------------
// some type definitions to simplify things for SWIG
#define %disownarg(typespec) %typemap(in) typespec = SWIGTYPE* DISOWN
#define %cleardisown(typespec) %typemap(in) typespec
+#define %ref %feature("ref")
+#define %unref %feature("unref")
#ifndef %pythoncode