summaryrefslogtreecommitdiff
path: root/Lib/perl5/perl5.swg
diff options
context:
space:
mode:
authorDave Beazley <dave-swig@dabeaz.com>2003-11-25 17:06:56 +0000
committerDave Beazley <dave-swig@dabeaz.com>2003-11-25 17:06:56 +0000
commit465eebfb32922ebfa0ab316373c17334d8808c2e (patch)
tree02bc6fab471a90a994a54f9c111981af53eab304 /Lib/perl5/perl5.swg
parent297b943f2e8088cd877a7ad44068539b7cf64597 (diff)
downloadswig-465eebfb32922ebfa0ab316373c17334d8808c2e.tar.gz
[ 841074 ] better croaking (PATCH)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5395 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/perl5/perl5.swg')
-rw-r--r--Lib/perl5/perl5.swg15
1 files changed, 9 insertions, 6 deletions
diff --git a/Lib/perl5/perl5.swg b/Lib/perl5/perl5.swg
index 7101bdc7c..20d903238 100644
--- a/Lib/perl5/perl5.swg
+++ b/Lib/perl5/perl5.swg
@@ -499,20 +499,23 @@
unsigned int,
unsigned long,
unsigned short {
- sprintf(_swigmsg,"%d",$1);
- SWIG_croak(_swigmsg);
+ SWIG_SetErrorf("%d", $1); SWIG_fail;
}
-%typemap(throws) SWIGTYPE {
- SWIG_croak("$1_type");
+/* throws real objects */
+%typemap(throws) SWIGTYPE
+{
+ SV *esv=sv_newmortal();
+ $&1_ltype copy = new $1_ltype(($1_ltype &)$1);
+ SWIG_MakePtr(esv, (void *) copy,
+ $&1_descriptor, SWIG_OWNER);
+ SWIG_croakSV(esv);
}
%typemap(throws) char * {
SWIG_croak($1);
- SWIG_fail;
}
-
/* Export the SWIG initialization function */
%header %{
#ifdef __cplusplus