[education/rkward/releases/0.8.3] rkward/rbackend: Fix compilation with R < 4.5.0
Thomas Friedrichsmeier
null at kde.org
Fri Apr 17 17:38:56 BST 2026
Git commit fb32c2796831d56d5f4796e931714abfeb57f1a2 by Thomas Friedrichsmeier.
Committed on 17/04/2026 at 16:38.
Pushed by tfry into branch 'releases/0.8.3'.
Fix compilation with R < 4.5.0
M +1 -1 rkward/rbackend/rkrapi.h
M +1 -1 rkward/rbackend/rkstructuregetter.cpp
https://invent.kde.org/education/rkward/-/commit/fb32c2796831d56d5f4796e931714abfeb57f1a2
diff --git a/rkward/rbackend/rkrapi.h b/rkward/rbackend/rkrapi.h
index 06c9ca365..8e7ba33fe 100644
--- a/rkward/rbackend/rkrapi.h
+++ b/rkward/rbackend/rkrapi.h
@@ -186,6 +186,7 @@ class RFn : public QObject {
IMPORT_R_API(R_DelayedBindingExpression);
IMPORT_R_API(R_DelayedBindingEnvironment);
//IMPORT_R_API(R_ForcedBindingExpression);
+ IMPORT_R_API(R_getVar);
// these were removed in R 4.6, but we still need them
// if using a lower R at runtime
static inline SEXP (*PRCODE)(SEXP) = nullptr;
@@ -275,7 +276,6 @@ class RFn : public QObject {
IMPORT_R_API(Rf_findVarInFrame);
IMPORT_R_API(Rf_getAttrib);
IMPORT_R_API(Rf_getCharCE);
- IMPORT_R_API(R_getVar);
IMPORT_R_API(Rf_initialize_R);
IMPORT_R_API(Rf_install);
IMPORT_R_API(Rf_installChar);
diff --git a/rkward/rbackend/rkstructuregetter.cpp b/rkward/rbackend/rkstructuregetter.cpp
index a44161c62..cfb0e99b7 100644
--- a/rkward/rbackend/rkstructuregetter.cpp
+++ b/rkward/rbackend/rkstructuregetter.cpp
@@ -154,7 +154,7 @@ SEXP RKStructureGetter::peekFromEnv(SEXP sym, SEXP env) {
if (!RFn::PRCODE) {
// We have neither the new nor the old promise handling functions?
// fall back to forcing
- return RFn::R_getVar(sym, env, /* inherits: */ FALSE);
+ return RFn::Rf_eval(sym, env); // R_getVar() may not be available, either
}
SEXP from = RFn::Rf_findVar(sym, env);
SEXP ret = from;
More information about the rkward-tracker
mailing list