diff options
| author | Slávek Banko <slavek.banko@axis.cz> | 2022-03-21 12:23:32 +0100 | 
|---|---|---|
| committer | Slávek Banko <slavek.banko@axis.cz> | 2022-03-22 09:52:15 +0100 | 
| commit | 37fb4f1823f38dbf31b26167e52b33117581d139 (patch) | |
| tree | 02135572229b328dd8a77495c4289980458fdce9 /lib/kross/ruby/rubyinterpreter.cpp | |
| parent | a7fd7623e104a599316c3b06b6ad048baa95835d (diff) | |
| download | koffice-37fb4f1823f38dbf31b26167e52b33117581d139.tar.gz koffice-37fb4f1823f38dbf31b26167e52b33117581d139.zip | |
Fix FTBFS with Ruby 3.x due to removed rb_set_safe_level.
In Ruby 2.7 the entire concept is deprecated and in Ruby 3.x is removed
entirely - see https://bugs.ruby-lang.org/issues/16131
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 920d54124a7ed87e205b280038934d9c3a55cee1)
Diffstat (limited to 'lib/kross/ruby/rubyinterpreter.cpp')
| -rw-r--r-- | lib/kross/ruby/rubyinterpreter.cpp | 4 | 
1 files changed, 4 insertions, 0 deletions
| diff --git a/lib/kross/ruby/rubyinterpreter.cpp b/lib/kross/ruby/rubyinterpreter.cpp index 18ae65955..3504ca7c4 100644 --- a/lib/kross/ruby/rubyinterpreter.cpp +++ b/lib/kross/ruby/rubyinterpreter.cpp @@ -16,6 +16,8 @@   * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,   * Boston, MA 02110-1301, USA.   ***************************************************************************/ + +#include "config.h"  #include "rubyinterpreter.h"  #include <map> @@ -83,12 +85,14 @@ RubyInterpreter::RubyInterpreter(Kross::Api::InterpreterInfo* info): Kross::Api:      {          initRuby();      } +#ifndef HAVE_RUBY_3      if(info->hasOption("safelevel") )      {          kross_rb_set_safe_level( info->getOption("safelevel")->value.toInt() );      } else {          kross_rb_set_safe_level(3); // if the safelevel option is undefined, set it to maximum level      } +#endif  } | 
