From e58be56584c7510639c55bb20f3000bd9b796284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Mon, 10 May 2021 20:19:48 +0200 Subject: [PATCH] Fix build on Fedora 34 / Ruby 3.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot --- lib/kross/configure.in.in | 3 +++ lib/kross/ruby/rubyscript.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/lib/kross/configure.in.in b/lib/kross/configure.in.in index ad95e6261..c9acf48b1 100644 --- a/lib/kross/configure.in.in +++ b/lib/kross/configure.in.in @@ -43,6 +43,9 @@ if test "x$compile_kross" = "xyes" ; then if test "$RUBY_SERIES" -ge "19"; then AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x]) fi + if test "$RUBY_SERIES" -ge "30"; then + AC_DEFINE_UNQUOTED(HAVE_RUBY_3, 1, [Defines if your system has Ruby 3.x]) + fi if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyhdrdir))"` = "true"; then RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyhdrdir))"` diff --git a/lib/kross/ruby/rubyscript.cpp b/lib/kross/ruby/rubyscript.cpp index 381785ff5..889383cd1 100644 --- a/lib/kross/ruby/rubyscript.cpp +++ b/lib/kross/ruby/rubyscript.cpp @@ -31,7 +31,9 @@ #include #include #else // HAVE_RUBY_1_9 +#ifndef HAVE_RUBY_3 #include +#endif // HAVE_RUBY_3 #endif // HAVE_RUBY_1_9 #include