summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Nadlinger <code@klickverbot.at>2011-01-29 21:31:53 +0000
committerDavid Nadlinger <code@klickverbot.at>2011-01-29 21:31:53 +0000
commit160ee9c937dc0a987f2783dd4a231db1349ae9b6 (patch)
treef03ad4444dbbf7c95ef72b3a41b1222b4c8c4703
parent85ed05c24142a61974c16c8ebaf83170c8b7b141 (diff)
downloadswig-160ee9c937dc0a987f2783dd4a231db1349ae9b6.tar.gz
[D] Support for C++ references to primitive types.
I am not sure why these typemaps were missing before since I included code for this in the C++ part of the feature, but please let me know if I missed some case where this could break generated code. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12406 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r--Lib/d/dswigtype.swg17
1 files changed, 12 insertions, 5 deletions
diff --git a/Lib/d/dswigtype.swg b/Lib/d/dswigtype.swg
index 5bb0bd951..41336dc91 100644
--- a/Lib/d/dswigtype.swg
+++ b/Lib/d/dswigtype.swg
@@ -18,7 +18,7 @@
%typemap(ctype) SWIGTYPE & "void *"
%typemap(imtype) SWIGTYPE & "void*"
-%typemap(dtype) SWIGTYPE & "$dclassname"
+%typemap(dtype, nativepointer="$dtype") SWIGTYPE & "$dclassname"
%typemap(ctype) SWIGTYPE *const& "void *"
%typemap(imtype) SWIGTYPE *const& "void*"
@@ -131,11 +131,18 @@
}
$result = ($1_ltype)$input; %}
-%typemap(ddirectorin) SWIGTYPE & "new $dclassname($winput, false)"
-%typemap(ddirectorout) SWIGTYPE & "$dclassname.swigGetCPtr($dcall)"
+%typemap(ddirectorin,
+ nativepointer="cast($dtype)$winput"
+) SWIGTYPE & "new $dclassname($winput, false)"
+%typemap(ddirectorout,
+ nativepointer="cast(void*)$dcall"
+) SWIGTYPE & "$dclassname.swigGetCPtr($dcall)"
-%typemap(din) SWIGTYPE & "$dclassname.swigGetCPtr($dinput)"
-%typemap(dout, excode=SWIGEXCODE) SWIGTYPE & {
+%typemap(din,
+ nativepointer="cast(void*)$dinput"
+) SWIGTYPE & "$dclassname.swigGetCPtr($dinput)"
+%typemap(dout, excode=SWIGEXCODE,
+ nativepointer="{\n auto ret = cast($dtype)$imcall;$excode\n return ret;\n}") SWIGTYPE & {
$dclassname ret = new $dclassname($imcall, $owner);$excode
return ret;
}