[education/rkward] rkward/rbackend: Fix compilation with R >= 4.2.0

Thomas Friedrichsmeier null at kde.org
Fri May 10 17:04:24 BST 2024


Git commit 4b7f2a5f9f5b871aec56d6e3ab192310a4ee0549 by Thomas Friedrichsmeier.
Committed on 04/05/2024 at 22:50.
Pushed by tfry into branch 'master'.

Fix compilation with R >= 4.2.0

M  +8    -1    rkward/rbackend/rkrapi.h
M  +1    -1    rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp

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

diff --git a/rkward/rbackend/rkrapi.h b/rkward/rbackend/rkrapi.h
index d2416b563..4baecf8b9 100644
--- a/rkward/rbackend/rkrapi.h
+++ b/rkward/rbackend/rkrapi.h
@@ -123,6 +123,7 @@ IMPORT_R_API(R_ClearExternalPtr);
 IMPORT_R_API(R_ExternalPtrTag);
 IMPORT_R_API(R_ExternalPtrAddr);
 IMPORT_R_API(R_GE_getVersion);
+#if R_VERSION >= R_Version(4, 1, 0)
 IMPORT_R_API(R_GE_linearGradientColour);
 IMPORT_R_API(R_GE_linearGradientExtend);
 IMPORT_R_API(R_GE_linearGradientNumStops);
@@ -142,13 +143,14 @@ IMPORT_R_API(R_GE_radialGradientNumStops);
 IMPORT_R_API(R_GE_radialGradientR1);
 IMPORT_R_API(R_GE_radialGradientR2);
 IMPORT_R_API(R_GE_radialGradientStop);
-IMPORT_R_API(R_GE_str2col);
 IMPORT_R_API(R_GE_tilingPatternExtend);
 IMPORT_R_API(R_GE_tilingPatternFunction);
 IMPORT_R_API(R_GE_tilingPatternHeight);
 IMPORT_R_API(R_GE_tilingPatternWidth);
 IMPORT_R_API(R_GE_tilingPatternX);
 IMPORT_R_API(R_GE_tilingPatternY);
+#endif
+IMPORT_R_API(R_GE_str2col);
 IMPORT_R_API(R_InputHandlers);
 IMPORT_R_API(R_MakeExternalPtr);
 IMPORT_R_API(R_ParseVector);
@@ -272,6 +274,11 @@ IMPORT_R_API(ptr_R_Suicide);
 IMPORT_R_API(ptr_R_WriteConsole);
 IMPORT_R_API(ptr_R_WriteConsoleEx);
 #endif
+
+#if R_VERSION >= R_Version(4, 2, 0)
+IMPORT_R_API(R_GE_clipPathFillRule);
+IMPORT_R_API(R_GE_maskType);
+#endif
 public:
 	static void init(void* dllinfo);
 };
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
index fef678bd6..93569fc7b 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_stubs.cpp
@@ -868,7 +868,7 @@ void RKD_UseGroup(SEXP ref, SEXP trans, pDevDesc dev) {
 
 	// NOTE: chaching parameters before starting the write, in case they are ill-formed and produce errors
 	qint32 index = 0;
-	if (!Rfn::RFn::Rf_isNull(ref)) index = RFn::INTEGER(ref)[0];
+	if (!RFn::Rf_isNull(ref)) index = RFn::INTEGER(ref)[0];
 	bool have_trans = (trans != ROb(R_NilValue));
 	double matrix[6];
 	if (have_trans) {



More information about the rkward-tracker mailing list