[education/rkward] rkward/rbackend: Fix compilation with R 4.3.x on Windows

Thomas Friedrichsmeier null at kde.org
Sat May 11 09:38:30 BST 2024


Git commit 2ea777c17fe9cfdcea06afb9412c9e186dc0d1f5 by Thomas Friedrichsmeier.
Committed on 11/05/2024 at 08:38.
Pushed by tfry into branch 'master'.

Fix compilation with R 4.3.x on Windows

M  +10   -0    rkward/rbackend/rkrapi.h

https://invent.kde.org/education/rkward/-/commit/2ea777c17fe9cfdcea06afb9412c9e186dc0d1f5

diff --git a/rkward/rbackend/rkrapi.h b/rkward/rbackend/rkrapi.h
index ede2cb0e1..cb68aa4ad 100644
--- a/rkward/rbackend/rkrapi.h
+++ b/rkward/rbackend/rkrapi.h
@@ -89,6 +89,16 @@ available as a config option.
 #	undef FALSE
 #endif
 
+#include <Rversion.h>
+
+#if defined(Win32) && (R_VERSION >= R_Version(4, 3, 0))
+// We don't use Complex.h ourselves, but it is included from Rinternals.h and comes with a non-standard definition
+// that trips up MSVC. Fortunately, we can disable that via a define.
+#define R_LEGACY_RCOMPLEX
+#include <R_ext/Complex.h>
+#undef R_LEGACY_RCOMPLEX
+#endif
+
 // Common includes
 #include <Rdefines.h>
 #include <R_ext/Rdynload.h>


More information about the rkward-tracker mailing list