Merge pull request #460 from opoplawski/octave4

Support for octave 4.0.0
This commit is contained in:
Karl Wette 2015-07-17 09:32:28 +02:00
commit 695b88f1ac
4 changed files with 59 additions and 16 deletions

View file

@ -31,6 +31,8 @@ matrix:
env: SWIGLANG=octave SWIGJOBS=-j3 # 3.2 env: SWIGLANG=octave SWIGJOBS=-j3 # 3.2
- compiler: gcc - compiler: gcc
env: SWIGLANG=octave SWIGJOBS=-j3 VER=3.8 env: SWIGLANG=octave SWIGJOBS=-j3 VER=3.8
- compiler: gcc
env: SWIGLANG=octave SWIGJOBS=-j3 VER=4.0
- compiler: gcc - compiler: gcc
env: SWIGLANG=perl5 env: SWIGLANG=perl5
- compiler: gcc - compiler: gcc

View file

@ -14,24 +14,18 @@ try
catch catch
end_try_catch end_try_catch
del_b = dc.delete_B;
try try
bb = dc.new_BB(); bb = dc.new_BB();
error("Whoa. new_BB created.") error("Whoa. new_BB created.")
catch catch
end_try_catch end_try_catch
del_bb = dc.delete_BB;
try try
c = dc.new_C(); c = dc.new_C();
error("Whoa. new_C created.") error("Whoa. new_C created.")
catch catch
end_try_catch end_try_catch
del_c = dc.delete_C;
cc = dc.new_CC(); cc = dc.new_CC();
dc.delete_CC(cc); dc.delete_CC(cc);
@ -41,24 +35,18 @@ try
catch catch
end_try_catch end_try_catch
del_d = dc.delete_D;
try try
dd = dc.new_DD(); dd = dc.new_DD();
error("Whoa. new_DD created") error("Whoa. new_DD created")
catch catch
end_try_catch end_try_catch
dd = dc.delete_DD;
try try
ad = dc.new_AD(); ad = dc.new_AD();
error("Whoa. new_AD created") error("Whoa. new_AD created")
catch catch
end_try_catch end_try_catch
del_ad = dc.delete_AD;
e = dc.new_E(); e = dc.new_E();
dc.delete_E(e); dc.delete_E(e);
@ -71,12 +59,10 @@ try
catch catch
end_try_catch end_try_catch
del_eb = dc.delete_EB;
f = dc.new_F(); f = dc.new_F();
try try
del_f = dc.delete_F; del_f = dc.delete_F(f);
error("Whoa. delete_F created") error("Whoa. delete_F created")
catch catch
end_try_catch end_try_catch
@ -86,7 +72,7 @@ dc.F_destroy(f);
g = dc.new_G(); g = dc.new_G();
try try
del_g = dc.delete_G; del_g = dc.delete_G(g);
error("Whoa. delete_G created") error("Whoa. delete_G created")
catch catch
end_try_catch end_try_catch

View file

@ -12,6 +12,7 @@
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
%{ %{
#include <climits>
#include <iostream> #include <iostream>
%} %}

View file

@ -868,6 +868,17 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
} }
#if defined (HAVE_HDF5) #if defined (HAVE_HDF5)
# if SWIG_OCTAVE_PREREQ(4,0,0)
virtual bool
save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) {
return true;
}
virtual bool
load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) {
return true;
}
# else
virtual bool virtual bool
save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) { save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) {
return true; return true;
@ -877,6 +888,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) { load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) {
return true; return true;
} }
# endif
#endif #endif
virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const { virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const {
@ -969,7 +981,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
return octave_value(); return octave_value();
} }
#if SWIG_OCTAVE_PREREQ(4,0,0)
void print(std::ostream &os, bool pr_as_read_syntax = false) {
#else
void print(std::ostream &os, bool pr_as_read_syntax = false) const { void print(std::ostream &os, bool pr_as_read_syntax = false) const {
#endif
if (is_string()) { if (is_string()) {
os << string_value(); os << string_value();
return; return;
@ -1089,6 +1105,15 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
{ return ptr->load_binary(is, swap, fmt); } { return ptr->load_binary(is, swap, fmt); }
#if defined (HAVE_HDF5) #if defined (HAVE_HDF5)
# if SWIG_OCTAVE_PREREQ(4,0,0)
virtual bool
save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats)
{ return ptr->save_hdf5(loc_id, name, save_as_floats); }
virtual bool
load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug)
{ return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); }
# else
virtual bool virtual bool
save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats)
{ return ptr->save_hdf5(loc_id, name, save_as_floats); } { return ptr->save_hdf5(loc_id, name, save_as_floats); }
@ -1096,6 +1121,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
virtual bool virtual bool
load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug)
{ return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); } { return ptr->load_hdf5(loc_id, name, have_h5giterate_bug); }
# endif
#endif #endif
virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const virtual octave_value convert_to_str(bool pad = false, bool force = false, char type = '"') const
@ -1104,14 +1130,22 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const virtual octave_value convert_to_str_internal(bool pad, bool force, char type) const
{ return ptr->convert_to_str_internal(pad, force, type); } { return ptr->convert_to_str_internal(pad, force, type); }
#if SWIG_OCTAVE_PREREQ(4,0,0)
void print(std::ostream &os, bool pr_as_read_syntax = false)
#else
void print(std::ostream &os, bool pr_as_read_syntax = false) const void print(std::ostream &os, bool pr_as_read_syntax = false) const
#endif
{ return ptr->print(os, pr_as_read_syntax); } { return ptr->print(os, pr_as_read_syntax); }
private: private:
#if !SWIG_OCTAVE_PREREQ(4,0,0)
DECLARE_OCTAVE_ALLOCATOR; DECLARE_OCTAVE_ALLOCATOR;
#endif
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
}; };
#if !SWIG_OCTAVE_PREREQ(4,0,0)
DEFINE_OCTAVE_ALLOCATOR(octave_swig_ref); DEFINE_OCTAVE_ALLOCATOR(octave_swig_ref);
#endif
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_ref, "swig_ref", "swig_ref"); DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_ref, "swig_ref", "swig_ref");
class octave_swig_packed:public octave_base_value { class octave_swig_packed:public octave_base_value {
@ -1143,7 +1177,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
return true; return true;
} }
#if SWIG_OCTAVE_PREREQ(4,0,0)
void print(std::ostream &os, bool pr_as_read_syntax = false) {
#else
void print(std::ostream &os, bool pr_as_read_syntax = false) const { void print(std::ostream &os, bool pr_as_read_syntax = false) const {
#endif
indent(os); indent(os);
os << "swig packed type: name = " << (type ? type->name : std::string()) << ", len = " << buf.size(); newline(os); os << "swig packed type: name = " << (type ? type->name : std::string()) << ", len = " << buf.size(); newline(os);
} }
@ -1167,6 +1205,17 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
} }
#if defined (HAVE_HDF5) #if defined (HAVE_HDF5)
# if SWIG_OCTAVE_PREREQ(4,0,0)
virtual bool
save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) {
return true;
}
virtual bool
load_hdf5 (octave_hdf5_id loc_id, const char *name, bool have_h5giterate_bug) {
return true;
}
# else
virtual bool virtual bool
save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) { save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) {
return true; return true;
@ -1176,13 +1225,18 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) { load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug) {
return true; return true;
} }
# endif
#endif #endif
private: private:
#if !SWIG_OCTAVE_PREREQ(4,0,0)
DECLARE_OCTAVE_ALLOCATOR; DECLARE_OCTAVE_ALLOCATOR;
#endif
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
}; };
#if !SWIG_OCTAVE_PREREQ(4,0,0)
DEFINE_OCTAVE_ALLOCATOR(octave_swig_packed); DEFINE_OCTAVE_ALLOCATOR(octave_swig_packed);
#endif
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_packed, "swig_packed", "swig_packed"); DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_packed, "swig_packed", "swig_packed");
SWIGRUNTIME octave_value_list octave_set_immutable(const octave_value_list &args, int nargout) { SWIGRUNTIME octave_value_list octave_set_immutable(const octave_value_list &args, int nargout) {