diff options
author | Marcelo Matus <mmatus@acms.arizona.edu> | 2004-12-21 20:07:16 +0000 |
---|---|---|
committer | Marcelo Matus <mmatus@acms.arizona.edu> | 2004-12-21 20:07:16 +0000 |
commit | 38f4a385096d9535550d67c0ed18a55fcd5d62fb (patch) | |
tree | ae3dce604b7a735a47247bfbcea78878b5a5042f /Lib | |
parent | 56dd829f7a323d09e9190faea349ba5f306628a1 (diff) | |
download | swig-38f4a385096d9535550d67c0ed18a55fcd5d62fb.tar.gz |
fix varin for ptr types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6909 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/python/pyptrtypes.swg | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/python/pyptrtypes.swg b/Lib/python/pyptrtypes.swg index 89dbfb94f..4737ecc31 100644 --- a/Lib/python/pyptrtypes.swg +++ b/Lib/python/pyptrtypes.swg @@ -43,13 +43,14 @@ Type *ptr = (Type *)0; int res = asptr_meth($input, &ptr); if (!res) { - if (!PyErr_Occurred()) + if (!PyErr_Occurred()) { SWIG_type_error("$basetype", $input); - SWIG_append_msg(" C/C++ variable '$name'"); + } + SWIG_append_errmsg(" C/C++ variable '$name'"); return 1; } else if (!ptr) { SWIG_null_ref("$basetype"); - SWIG_append_msg(" C/C++ variable '$name'"); + SWIG_append_errmsg(" C/C++ variable '$name'"); return 1; } $1 = *ptr; @@ -69,6 +70,7 @@ $result = &temp; if (res == SWIG_NEWOBJ) delete ptr; } + %typemap(directorout,fragment=pyfrag) Type { Type *ptr = 0; int res = $input ? asptr_meth($input, &ptr) : 0; @@ -77,7 +79,8 @@ $result = *ptr; if (res == SWIG_NEWOBJ) delete ptr; } -%typemap(directorout,fragment=pyfrag,warning="470:Possible thread/reentrant unsafe wrapping, consider using a plain '"#Type"' return type instead.") const Type& { + + %typemap(directorout,fragment=pyfrag,warning="470:Possible thread/reentrant unsafe wrapping, consider using a plain '"#Type"' return type instead.") const Type& { Type *ptr = 0; int res = $input ? asptr_meth($input, &ptr) : 0; if (!res || !ptr) @@ -92,7 +95,9 @@ $result = ptr; } } + %typemap(directorout,fragment=pyfrag) Type &DIRECTOROUT = Type + %enddef /* typecheck */ |