Revert "Octave: drop support for Octave versions older than 3.2.0"

This reverts commit 952eee8f59.

Reverting a series of Octave commits for re-applying again without
incorrect whitespace changes.
This commit is contained in:
William S Fulton 2014-10-09 19:33:58 +01:00
commit bfa3d378ec
6 changed files with 25 additions and 16 deletions

View file

@ -101,11 +101,6 @@
#endif // !defined(OCTAVE_MAJOR_VERSION)
// Set minimum supported Octave version
#if !SWIG_OCTAVE_PREREQ(3,2,0)
#error This version of SWIG supports only Octave version 3.2.0 or later
#endif
// Octave_map was renamed to octave_map in v3.3.52
#if !SWIG_OCTAVE_PREREQ(3,3,52)
#define octave_map Octave_map
@ -113,7 +108,11 @@
////////// Declare/define SWIG interface function loadable by Octave //////////
#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, G ## cname, args, nargout, doc)
#if !SWIG_OCTAVE_PREREQ(3,2,0)
#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, FS ## cname, args, nargout, doc)
#else
#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, G ## cname, args, nargout, doc)
#endif
////////// Define visibility of Octave runtime functions //////////

View file

@ -130,10 +130,14 @@ SWIGOCTRT void SWIG_Octave_SetGlobalValue(std::string name, const octave_value&
SWIGOCTRT void SWIG_Octave_LinkGlobalValue(std::string name)
{
#if !SWIG_OCTAVE_PREREQ(3,2,0)
link_to_global_variable(curr_sym_tab->lookup(name, true));
#else
#if !SWIG_OCTAVE_PREREQ(3,8,0)
symbol_table::varref(name);
#endif
symbol_table::mark_global(name);
#endif
}
SWIGOCTRT swig_module_info* SWIG_Octave_GetModule(void* clientdata)

View file

@ -295,7 +295,7 @@ DEFUN_DLD(SWIG_name, args, nargout, SWIG_name_usage)
// definitely affects version 3.2.*, not sure about 3.3.*, seems to be fixed in
// version 3.4.* and above. can be turned off with macro definition.
#ifndef SWIG_OCTAVE_NO_SEGFAULT_HACK
#if !SWIG_OCTAVE_PREREQ(3,4,1)
#if SWIG_OCTAVE_PREREQ(3,2,0) && !SWIG_OCTAVE_PREREQ(3,4,1)
octave_exit = ::_Exit;
#endif
#endif
@ -311,6 +311,7 @@ DEFUN_DLD(SWIG_name, args, nargout, SWIG_name_usage)
// workaround bug in octave where installing global variable of custom type and then
// exiting without explicitly clearing the variable causes octave to segfault.
#if SWIG_OCTAVE_PREREQ(3,2,0)
octave_value_list eval_args;
eval_args.append("base");
eval_args.append("function __swig_atexit__; "
@ -324,6 +325,7 @@ DEFUN_DLD(SWIG_name, args, nargout, SWIG_name_usage)
"atexit(\"__swig_atexit__\", false); "
"atexit(\"__swig_atexit__\")");
feval("evalin", eval_args, 0);
#endif
SwigOctRef::register_type();
SwigOctPacked::register_type();
@ -396,7 +398,11 @@ DEFUN_DLD(SWIG_name, args, nargout, SWIG_name_usage)
}
}
#if !SWIG_OCTAVE_PREREQ(3,2,0)
mlock(me->name());
#else
mlock();
#endif
}