[education/rkward] /: Fix compilation with R 4.6

Thomas Friedrichsmeier null at kde.org
Sun Mar 22 08:53:05 GMT 2026


Git commit 4d7719f9ae5af972717ee13e9c4ba21f7d13acc8 by Thomas Friedrichsmeier.
Committed on 22/03/2026 at 08:53.
Pushed by tfry into branch 'master'.

Fix compilation with R 4.6

M  +1    -0    ChangeLog
M  +4    -4    rkward/rbackend/rkrapi.h
M  +1    -1    rkward/rbackend/rkrbackend.cpp

https://invent.kde.org/education/rkward/-/commit/4d7719f9ae5af972717ee13e9c4ba21f7d13acc8

diff --git a/ChangeLog b/ChangeLog
index 94d189258..74dd1e7fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 --- Version 0.8.3 - UNRELEASED
+- Fixed: Allow compilation with the upcoming R 4.6
 - Fixed: Horizontal text alignment would be inaccurate for some symbols in RK() device
 - Fixed: Parts of a command entered interactively could run twice under specific circumstances
 - Fixed: Output window would fail to open, automatically, for certain plugins
diff --git a/rkward/rbackend/rkrapi.h b/rkward/rbackend/rkrapi.h
index 31f15a52b..6296f2d60 100644
--- a/rkward/rbackend/rkrapi.h
+++ b/rkward/rbackend/rkrapi.h
@@ -99,18 +99,19 @@ available as a config option.
 #	undef R_LEGACY_RCOMPLEX
 #endif
 
-// Common includes
+// Common includes. NOTE: not includable in arbitrary order -> clang-format off
+// clang-format off
 #include <R.h>
-#include <R_ext/Callbacks.h>
+#include <Rdefines.h>
 #include <R_ext/Parse.h>
 #include <R_ext/Rdynload.h>
 #include <R_ext/Riconv.h>
-#include <Rdefines.h>
 #include <Rembedded.h>
 #include <Rinternals.h>
 #include <Rversion.h>
 #define R_USE_PROTOTPYES 1
 #include <R_ext/GraphicsEngine.h>
+// clang-format on
 
 // rcolor typedef added in R 3.0.0
 #ifndef rcolor
@@ -228,7 +229,6 @@ class RFn : public QObject {
 	IMPORT_R_API(R_registerRoutines);
 	IMPORT_R_API(R_removeVarFromFrame);
 	IMPORT_R_API(R_tryEval);
-	IMPORT_R_API(Rf_GetOption);
 	IMPORT_R_API(Rf_GetOption1);
 	IMPORT_R_API(Rf_KillAllDevices);
 	IMPORT_R_API(Rf_ScalarInteger);
diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index 6600fe48b..e69ec744c 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -305,7 +305,7 @@ int RReadConsole(const char *prompt, unsigned char *buf, int buflen, int hist) {
 					// fully transmitted, but R is still asking for more, without signalling R_Busy? This looks like an incomplete statement.
 					// HOWEVER: It may also have been a (trailing) empty statement such as "\n", so let's check whether the prompt looks like a "continue" prompt
 					RBusy(1); // Mark command as "running"
-					if (RKTextCodec::fromNative(prompt) == RKRSupport::SEXPToString(RFn::Rf_GetOption(RFn::Rf_install("continue"), ROb(R_BaseEnv)))) {
+					if (RKTextCodec::fromNative(prompt) == RKRSupport::SEXPToString(RFn::Rf_GetOption1(RFn::Rf_install("continue")))) {
 						RKRBackend::this_pointer->current_command->status |= RCommand::Failed | RCommand::ErrorIncomplete;
 						RKRBackend::repl_status.user_command_status = RKRBackend::RKReplStatus::ReplIterationKilled;
 						RK_doIntr(); // to discard the buffer


More information about the rkward-tracker mailing list