Fix wrapping of references/pointers and qualifiers to member pointers

Also fix Go wrapping of member const function pointers.
This commit is contained in:
William S Fulton 2017-03-16 21:04:38 +00:00
commit 72ba741d1c
21 changed files with 70 additions and 42 deletions

View file

@ -232,6 +232,8 @@ $body)"
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* name conversion for overloaded operators. */
#ifdef __cplusplus

View file

@ -136,6 +136,8 @@
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
%{

View file

@ -716,6 +716,8 @@ $result = C_SCHEME_UNDEFINED;
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* ------------------------------------------------------------
* Overloaded operator support

View file

@ -843,6 +843,13 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
$*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode
return ret;
}
%typemap(csvarout, excode=SWIGEXCODE) SWIGTYPE *const& %{
get {
global::System.IntPtr cPtr = $imcall;
$*csclassname ret = (cPtr == global::System.IntPtr.Zero) ? null : new $*csclassname(cPtr, $owner);$excode
return ret;
} %}
%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0)
%{ temp = ($*1_ltype)$input;
$1 = ($1_ltype)&temp; %}
@ -1011,6 +1018,8 @@ SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE)
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* csharp keywords */
%include <csharpkw.swg>

View file

@ -43,6 +43,8 @@
return ret;
}
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/*
* Helper functions to pack/unpack arbitrary binary data (member function

View file

@ -341,8 +341,6 @@
%typemap(directorout) SWIGTYPE *
%{ $result = *($&1_ltype)&$input; %}
%apply SWIGTYPE * { SWIGTYPE *const }
/* Pointer references. */
%typemap(gotype) SWIGTYPE *const&
@ -692,6 +690,10 @@
SWIGTYPE (CLASS::*)
""
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* Go keywords. */
%include <gokw.swg>

View file

@ -468,5 +468,7 @@ typedef unsigned long SCM;
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* typemaps.i ends here */

View file

@ -1338,6 +1338,8 @@ SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE)
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* String & length */
%typemap(jni) (char *STRING, size_t LENGTH) "jbyteArray"

View file

@ -386,6 +386,8 @@ parameters match which function
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
// size_t (which is just a unsigned long)
%apply unsigned long { size_t };

View file

@ -782,4 +782,6 @@ FROM BlaBla IMPORT Bla;
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }

View file

@ -368,4 +368,6 @@ SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val);
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }

View file

@ -525,7 +525,8 @@
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* php keywords */
%include <phpkw.swg>

View file

@ -523,7 +523,8 @@
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* php keywords */
%include <phpkw.swg>

View file

@ -273,6 +273,8 @@ extern "C" {
/* const pointers */
%apply SWIGTYPE * { SWIGTYPE *const }
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* ------------------------------------------------------------
* Overloaded operator support

View file

@ -584,6 +584,9 @@
}
#endif
%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
/* ------------------------------------------------------------
* --- function ptr typemaps ---
* ------------------------------------------------------------ */