summaryrefslogtreecommitdiff
path: root/Lib/octave
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2014-10-09 19:33:58 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2014-10-09 19:33:58 +0100
commitbfa3d378eccd3817d39db44055f05600008340f4 (patch)
treebceda16934c32d2e0d442dc83c95def694f533e2 /Lib/octave
parentb1595014e772c7ecc56b114bf994f35d75c58ba6 (diff)
downloadswig-bfa3d378eccd3817d39db44055f05600008340f4.tar.gz
Revert "Octave: drop support for Octave versions older than 3.2.0"
This reverts commit 952eee8f5904f85411d28dd375cc7df67f74b95a. Reverting a series of Octave commits for re-applying again without incorrect whitespace changes.
Diffstat (limited to 'Lib/octave')
-rw-r--r--Lib/octave/octrundecl.swg11
-rw-r--r--Lib/octave/octrunfunc.swg4
-rw-r--r--Lib/octave/octruninit.swg8
3 files changed, 16 insertions, 7 deletions
diff --git a/Lib/octave/octrundecl.swg b/Lib/octave/octrundecl.swg
index 6452aec97..f71895abb 100644
--- a/Lib/octave/octrundecl.swg
+++ b/Lib/octave/octrundecl.swg
@@ -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 //////////
diff --git a/Lib/octave/octrunfunc.swg b/Lib/octave/octrunfunc.swg
index 34dae2ee2..6773373b8 100644
--- a/Lib/octave/octrunfunc.swg
+++ b/Lib/octave/octrunfunc.swg
@@ -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)
diff --git a/Lib/octave/octruninit.swg b/Lib/octave/octruninit.swg
index 7d83a5633..86d033af2 100644
--- a/Lib/octave/octruninit.swg
+++ b/Lib/octave/octruninit.swg
@@ -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
}