Fix an incompatibility with never versions of Octave (by Karl Wette)

According to the Octave changelog (ChangeLog and src/ChangeLog
in the Octave 3.4.0 source), octave_base_value::map_value() now
returns an octave_map instead of an Octave_map; this change dates
from Octave API version 40 onward. This patch makes the necessary
changes to the SWIG runtime while remaining backward-compatible.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12673 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Xavier Delacour 2011-05-17 01:59:53 +00:00
commit 360c1aaa1b
2 changed files with 12 additions and 1 deletions

View file

@ -715,9 +715,15 @@ namespace Swig {
return outarg(0).string_value();
}
#if OCTAVE_API_VERSION_NUMBER >= 40
virtual octave_map map_value() const {
return octave_map();
}
#else
virtual Octave_map map_value() const {
return Octave_map();
}
#endif
virtual string_vector map_keys() const {
member_map tmp;
@ -929,8 +935,13 @@ namespace Swig {
virtual std::string string_value(bool force = false) const
{ return ptr->string_value(force); }
#if OCTAVE_API_VERSION_NUMBER >= 40
virtual octave_map map_value() const
{ return ptr->map_value(); }
#else
virtual Octave_map map_value() const
{ return ptr->map_value(); }
#endif
virtual string_vector map_keys() const
{ return ptr->map_keys(); }

View file

@ -61,7 +61,7 @@
%typemap(out) octave_value_list {
_outp->append($1);
}
%typemap(out,noblock=1) Octave_map {
%typemap(out,noblock=1) octave_map, Octave_map {
$result=$1;
}
%typemap(out,noblock=1) NDArray {