[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:
parent
1d088d7124
commit
bb15c4eccf
3 changed files with 15 additions and 1 deletions
|
|
@ -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)
|
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
|
2022-02-07: sethrj
|
||||||
#2196 Add alternative syntax for specifying fragments in typemaps.
|
#2196 Add alternative syntax for specifying fragments in typemaps.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.
|
# Regression test for bug fixed in SWIG 4.1.0.
|
||||||
if {[sum []] != 0} { error "bad vector sum" }
|
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()" }
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ namespace std {
|
||||||
T* temp;
|
T* temp;
|
||||||
|
|
||||||
if(SWIG_ConvertPtr($input, (void **) &v, \
|
if(SWIG_ConvertPtr($input, (void **) &v, \
|
||||||
$&1_descriptor, 0) == 0) {
|
$1_descriptor, 0) == 0) {
|
||||||
$1 = v;
|
$1 = v;
|
||||||
} else {
|
} else {
|
||||||
// It isn't a vector< T > so it should be a list of T's
|
// It isn't a vector< T > so it should be a list of T's
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue