[Tcl] Fix Tcl generic input typemap for std::vector

Fixes https://sourceforge.net/p/swig/bugs/1207/
Fixes https://sourceforge.net/p/swig/bugs/1213/
This commit is contained in:
Olly Betts 2022-02-10 09:55:58 +13:00
commit bb15c4eccf
3 changed files with 15 additions and 1 deletions

View file

@ -7,6 +7,12 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.1.0 (in progress)
===========================
2022-02-10: olly
[Tcl] https://sourceforge.net/p/swig/bugs/1207/
https://sourceforge.net/p/swig/bugs/1213/
Fix Tcl generic input typemap for std::vector.
2022-02-07: sethrj
#2196 Add alternative syntax for specifying fragments in typemaps.

View file

@ -5,3 +5,11 @@ if [ catch { load ./li_std_vector[info sharedlibextension] li_std_vector} err_ms
# Regression test for bug fixed in SWIG 4.1.0.
if {[sum []] != 0} { error "bad vector sum" }
IntPtrVector v 6
if {[v empty] != 0} { error "bad std::vector::empty()" }
if {[v size] != 6} { error "bad std::vector::size()" }
# Test that calling get succeeds
v get 0
v pop
if {[v size] != 5} { error "bad std::vector::size()" }

View file

@ -118,7 +118,7 @@ namespace std {
T* temp;
if(SWIG_ConvertPtr($input, (void **) &v, \
$&1_descriptor, 0) == 0) {
$1_descriptor, 0) == 0) {
$1 = v;
} else {
// It isn't a vector< T > so it should be a list of T's