- or download this
%header %{
#undef SWIG_Error // if placed in %wrapper it will be at th
+e end, too late for the wrapper code
#define SWIG_Error(code, msg) call_perl_carp
+((char *) SWIG_ErrorType(code), (char *) msg)
...
use Carp; # ensure Carp.pm is available for wrap
+per argument validation
%}
- or download this
#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail
+; }
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG
+_RuntimeError, msg); SWIG_fail; } else
#define SWIG_SetError(str) SWIG_Error(SWI
+G_RuntimeError, str)
- or download this
if (!argp2) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference "
"in method '" "new_Foo" "', argument " "2"" of type '" "Bar &""'");
}
- or download this
#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWI
+G_fail; } while(0)
#define SWIG_Error(code, msg) sv_setpvf(GvSV
+(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
...
SWIG_Perl_ErrorType(int code) { C code that returns a string describin
+g the error code }
#define SWIG_fail goto fail
#define SWIG_croak_null() croak(Nullch)