فهرست منبع

HPCC-19718 ‘R_NewHashedEnv’ was not declared in R

Seems like rcpp maintainers have no interest in maintaining back-compatibility
between versions, which can be a bit of a pain.

This code compiles (and seems to run) ok on my 16.04 Ubuntu box, with (I
think) version 0.12.3 of Rcpp.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 سال پیش
والد
کامیت
cc3424c32e
1فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 5 5
      plugins/Rembed/Rembed.cpp

+ 5 - 5
plugins/Rembed/Rembed.cpp

@@ -95,17 +95,17 @@ extern "C" DECL_EXPORT bool getECLPluginDefinition(ECLPluginDefinitionBlock *pb)
 #define UNSUPPORTED(feature) throw MakeStringException(MSGAUD_user, 0, "Rembed: UNSUPPORTED feature: %s", feature)
 #define FAIL(msg) throw MakeStringException(MSGAUD_user, 0, "Rembed: Rcpp error: %s", msg)
 
+using Rcpp::_;
+
 namespace Rembed
 {
-// Copied from Rcpp 3.3's environment.h, in case an older version of Rcpp is in use
+// Copied from Rcpp 0.12.15's meat/Environment.h, in case an older version of Rcpp is in use
 inline Rcpp::Environment _new_env(SEXP parent, int size = 29) {
-    Rcpp::Shield<SEXP> sizeSEXP(Rf_ScalarInteger(size));
-    Rcpp::Shield<SEXP> parentSEXP(parent);
-    return R_NewHashedEnv(parentSEXP, sizeSEXP);
+    Rcpp::Function newEnv("new.env", R_BaseNamespace);
+    return newEnv(_["size"] = size, _["parent"] = parent);
 }
 
 
-
 __declspec(noreturn) static void failx(const char *msg, ...) __attribute__((format(printf, 1, 2), noreturn));
 
 static void failx(const char *message, ...)