From bfa3d378eccd3817d39db44055f05600008340f4 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 9 Oct 2014 19:33:58 +0100 Subject: [PATCH] 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. --- CHANGES.current | 7 ------- Doc/Manual/Octave.html | 5 +++-- Examples/octave/module_load/runme.m | 6 ++++++ Lib/octave/octrundecl.swg | 11 +++++------ Lib/octave/octrunfunc.swg | 4 ++++ Lib/octave/octruninit.swg | 8 +++++++- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index 3b81a63bd..b305c7627 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,13 +5,6 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.3 (in progress) =========================== -2014-10-04: kwwette - [Octave] Drop support for Octave versions older than 3.2.0 - - Latest non-supported version is 3.0.5, released 2009-04-09 - - Earliest supported version is 3.2.0, released 2009-06-05 - - *** POTENTIAL INCOMPATIBILITY *** - 2014-09-30: oliverb [Javascript] Merge patch #216 by Richie765 - Added support for many versions of v8 javascript. diff --git a/Doc/Manual/Octave.html b/Doc/Manual/Octave.html index 3ba477b37..e48083afd 100644 --- a/Doc/Manual/Octave.html +++ b/Doc/Manual/Octave.html @@ -58,8 +58,9 @@ in the test suite (Examples/test-suite and Examples/test-suite/octave).

32.1 Preliminaries

-SWIG version 3.0.3 supports only Octave version 3.2.0 or later. It has -been tested with Octave versions 3.2.4, 3.4.3, 3.6.4, and 3.8.1. +As of SWIG 3.0.0, the Octave module has been tested with Octave versions 3.0.5, +3.2.4, 3.4.3, 3.6.4, and 3.8.0. Use of Octave versions older than 3.x.x is not +recommended, as these versions are no longer tested with SWIG.

32.2 Running SWIG

diff --git a/Examples/octave/module_load/runme.m b/Examples/octave/module_load/runme.m index 758df9c93..bc311b5e6 100644 --- a/Examples/octave/module_load/runme.m +++ b/Examples/octave/module_load/runme.m @@ -61,6 +61,12 @@ testme testme clear all +# octave 3.0.5 randomly crashes on the remaining tests, so skip them +api_version = sscanf(octave_config_info("api_version"), "api-v%i"); +if api_version < 37 + exit +endif + # load module with no cvar clear all; swigexample2; 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 }