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/lua | |
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/lua')
-rw-r--r-- | Lib/lua/std_auto_ptr.i | 6 | ||||
-rw-r--r-- | Lib/lua/std_unique_ptr.i | 6 |
2 files changed, 12 insertions, 0 deletions
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 |