[rkward-cvs] SF.net SVN: rkward:[2410] trunk/rkward/rkward/rbackend/rembedinternal.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Mar 25 12:46:18 UTC 2009


Revision: 2410
          http://rkward.svn.sourceforge.net/rkward/?rev=2410&view=rev
Author:   tfry
Date:     2009-03-25 12:46:18 +0000 (Wed, 25 Mar 2009)

Log Message:
-----------
Support for R 2.9 (needs recompilation)

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rembedinternal.cpp

Modified: trunk/rkward/rkward/rbackend/rembedinternal.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rembedinternal.cpp	2009-03-05 21:23:18 UTC (rev 2409)
+++ trunk/rkward/rkward/rbackend/rembedinternal.cpp	2009-03-25 12:46:18 UTC (rev 2410)
@@ -65,6 +65,10 @@
 #define R_2_7
 #endif
 
+#if (R_VERSION > R_Version(2, 8, 9))
+#define R_2_9
+#endif
+
 extern "C" {
 #define R_INTERFACE_PTRS 1
 
@@ -522,7 +526,11 @@
 	QString *list = new QString[*count];
 	unsigned int i = 0;
 	for (; i < *count; ++i) {
+#ifdef R_2_9
+		SEXP dummy = STRING_ELT (from_exp, i);
+#else
 		SEXP dummy = VECTOR_ELT (from_exp, i);
+#endif
 
 		if (TYPEOF (dummy) != CHARSXP) {
 			list[i] = QString ("not defined");	// can this ever happen?
@@ -800,7 +808,11 @@
 	const char *command = localc.data ();
 
 	PROTECT(cv=allocVector(STRSXP, 1));
-	SET_VECTOR_ELT(cv, 0, mkChar(command));  
+#ifdef R_2_9
+	SET_STRING_ELT(cv, 0, mkChar(command));
+#else
+	SET_VECTOR_ELT(cv, 0, mkChar(command));
+#endif
 
 	// TODO: Maybe we can use R_ParseGeneral instead. Then we could find the exact character, where parsing fails. Nope: not exported API
 #ifdef R_2_5


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list