diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2022-09-17 10:23:51 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2022-09-17 10:23:51 +0100 |
commit | e97181ebc07a4755c1ab3e6f08eef12a3f9de07e (patch) | |
tree | 16dc71ce60c3a97a93976af5fdd5e86482aaa8c1 /Lib | |
parent | f0af17b3244d98109a62e3fda5ab6e5fc458283d (diff) | |
download | swig-e97181ebc07a4755c1ab3e6f08eef12a3f9de07e.tar.gz |
Add missing typecheck typemaps for std::auto_ptr and std::unique_ptr
To fix overloading when using these types.
Diffstat (limited to 'Lib')
28 files changed, 144 insertions, 0 deletions
diff --git a/Lib/csharp/std_auto_ptr.i b/Lib/csharp/std_auto_ptr.i index 78d7eaf4c..da15df3e9 100644 --- a/Lib/csharp/std_auto_ptr.i +++ b/Lib/csharp/std_auto_ptr.i @@ -28,6 +28,8 @@ return ret; } +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/csharp/std_unique_ptr.i b/Lib/csharp/std_unique_ptr.i index 2233cdc06..0a4caafbc 100644 --- a/Lib/csharp/std_unique_ptr.i +++ b/Lib/csharp/std_unique_ptr.i @@ -28,6 +28,8 @@ return ret; } +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/d/std_auto_ptr.i b/Lib/d/std_auto_ptr.i index e04a18061..500b6115a 100644 --- a/Lib/d/std_auto_ptr.i +++ b/Lib/d/std_auto_ptr.i @@ -32,6 +32,8 @@ return ret; } +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/d/std_unique_ptr.i b/Lib/d/std_unique_ptr.i index 8a06ba066..9317a7e0e 100644 --- a/Lib/d/std_unique_ptr.i +++ b/Lib/d/std_unique_ptr.i @@ -32,6 +32,8 @@ return ret; } +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/guile/std_auto_ptr.i b/Lib/guile/std_auto_ptr.i index 1b1253a16..59d5c0ed8 100644 --- a/Lib/guile/std_auto_ptr.i +++ b/Lib/guile/std_auto_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/guile/std_unique_ptr.i b/Lib/guile/std_unique_ptr.i index 5fc4dc490..6f907e90c 100644 --- a/Lib/guile/std_unique_ptr.i +++ b/Lib/guile/std_unique_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/java/std_auto_ptr.i b/Lib/java/std_auto_ptr.i index 6d65f0451..aee9b4828 100644 --- a/Lib/java/std_auto_ptr.i +++ b/Lib/java/std_auto_ptr.i @@ -31,6 +31,8 @@ return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::auto_ptr< TYPE > "" + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/java/std_unique_ptr.i b/Lib/java/std_unique_ptr.i index e1e5a2622..838ca495a 100644 --- a/Lib/java/std_unique_ptr.i +++ b/Lib/java/std_unique_ptr.i @@ -31,6 +31,8 @@ return (cPtr == 0) ? null : new $typemap(jstype, TYPE)(cPtr, true); } +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *") std::unique_ptr< TYPE > "" + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/javascript/jsc/std_auto_ptr.i b/Lib/javascript/jsc/std_auto_ptr.i index d062886e4..3d7ae8ba1 100644 --- a/Lib/javascript/jsc/std_auto_ptr.i +++ b/Lib/javascript/jsc/std_auto_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/javascript/jsc/std_unique_ptr.i b/Lib/javascript/jsc/std_unique_ptr.i index 1a7ec06fa..f988714df 100644 --- a/Lib/javascript/jsc/std_unique_ptr.i +++ b/Lib/javascript/jsc/std_unique_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/javascript/v8/std_auto_ptr.i b/Lib/javascript/v8/std_auto_ptr.i index d062886e4..3d7ae8ba1 100644 --- a/Lib/javascript/v8/std_auto_ptr.i +++ b/Lib/javascript/v8/std_auto_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/javascript/v8/std_unique_ptr.i b/Lib/javascript/v8/std_unique_ptr.i index 1a7ec06fa..f988714df 100644 --- a/Lib/javascript/v8/std_unique_ptr.i +++ b/Lib/javascript/v8/std_unique_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/lua/std_auto_ptr.i b/Lib/lua/std_auto_ptr.i index 3952d6dd6..b3b71d0f2 100644 --- a/Lib/lua/std_auto_ptr.i +++ b/Lib/lua/std_auto_ptr.i @@ -25,6 +25,12 @@ SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++; %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/lua/std_unique_ptr.i b/Lib/lua/std_unique_ptr.i index 4c1c1fde5..ad08f3b0e 100644 --- a/Lib/lua/std_unique_ptr.i +++ b/Lib/lua/std_unique_ptr.i @@ -25,6 +25,12 @@ SWIG_NewPointerObj(L, $1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); SWIG_arg++; %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr(L, $input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/mzscheme/std_auto_ptr.i b/Lib/mzscheme/std_auto_ptr.i index dd55230b3..c61bc8b26 100644 --- a/Lib/mzscheme/std_auto_ptr.i +++ b/Lib/mzscheme/std_auto_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/mzscheme/std_unique_ptr.i b/Lib/mzscheme/std_unique_ptr.i index af602c342..53cf46694 100644 --- a/Lib/mzscheme/std_unique_ptr.i +++ b/Lib/mzscheme/std_unique_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/octave/std_auto_ptr.i b/Lib/octave/std_auto_ptr.i index d062886e4..3d7ae8ba1 100644 --- a/Lib/octave/std_auto_ptr.i +++ b/Lib/octave/std_auto_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/octave/std_unique_ptr.i b/Lib/octave/std_unique_ptr.i index 1a7ec06fa..f988714df 100644 --- a/Lib/octave/std_unique_ptr.i +++ b/Lib/octave/std_unique_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/perl5/std_auto_ptr.i b/Lib/perl5/std_auto_ptr.i index d062886e4..3d7ae8ba1 100644 --- a/Lib/perl5/std_auto_ptr.i +++ b/Lib/perl5/std_auto_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/perl5/std_unique_ptr.i b/Lib/perl5/std_unique_ptr.i index 1a7ec06fa..f988714df 100644 --- a/Lib/perl5/std_unique_ptr.i +++ b/Lib/perl5/std_unique_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/php/std_auto_ptr.i b/Lib/php/std_auto_ptr.i index bd07dbdb5..284091657 100644 --- a/Lib/php/std_auto_ptr.i +++ b/Lib/php/std_auto_ptr.i @@ -27,6 +27,12 @@ SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/php/std_unique_ptr.i b/Lib/php/std_unique_ptr.i index 168273663..1bf31595e 100644 --- a/Lib/php/std_unique_ptr.i +++ b/Lib/php/std_unique_ptr.i @@ -27,6 +27,12 @@ SWIG_SetPointerZval($result, (void *)$1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr(&$input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/python/std_auto_ptr.i b/Lib/python/std_auto_ptr.i index d062886e4..3d7ae8ba1 100644 --- a/Lib/python/std_auto_ptr.i +++ b/Lib/python/std_auto_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/python/std_unique_ptr.i b/Lib/python/std_unique_ptr.i index 1a7ec06fa..f988714df 100644 --- a/Lib/python/std_unique_ptr.i +++ b/Lib/python/std_unique_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/ruby/std_auto_ptr.i b/Lib/ruby/std_auto_ptr.i index d062886e4..3d7ae8ba1 100644 --- a/Lib/ruby/std_auto_ptr.i +++ b/Lib/ruby/std_auto_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/ruby/std_unique_ptr.i b/Lib/ruby/std_unique_ptr.i index 1a7ec06fa..f988714df 100644 --- a/Lib/ruby/std_unique_ptr.i +++ b/Lib/ruby/std_unique_ptr.i @@ -25,6 +25,12 @@ %set_output(SWIG_NewPointerObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN | %newpointer_flags)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef diff --git a/Lib/tcl/std_auto_ptr.i b/Lib/tcl/std_auto_ptr.i index 3030a1bdf..b24809af7 100644 --- a/Lib/tcl/std_auto_ptr.i +++ b/Lib/tcl/std_auto_ptr.i @@ -25,6 +25,12 @@ Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::auto_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::auto_ptr< TYPE >; %enddef diff --git a/Lib/tcl/std_unique_ptr.i b/Lib/tcl/std_unique_ptr.i index 704055676..0ea324cda 100644 --- a/Lib/tcl/std_unique_ptr.i +++ b/Lib/tcl/std_unique_ptr.i @@ -25,6 +25,12 @@ Tcl_SetObjResult(interp, SWIG_NewInstanceObj($1.release(), $descriptor(TYPE *), SWIG_POINTER_OWN)); %} +%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="TYPE *", noblock=1) std::unique_ptr< TYPE > { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor(TYPE *), 0); + $1 = SWIG_CheckState(res); +} + %template() std::unique_ptr< TYPE >; %enddef |