From 09e176a5e5f280be1e83d70546bbaaa5d0f13c7d Mon Sep 17 00:00:00 2001
From: stepan <stepan.sindelar@oracle.com>
Date: Wed, 4 Oct 2017 12:32:47 +0200
Subject: [PATCH] Add R_MakeExternalPtrFn and R_ExternalPtrAddrFn RAPI
 functions

---
 .../src/truffle_common/Rinternals_truffle_common.h     | 10 ++++++++++
 com.oracle.truffle.r.native/version.source             |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/com.oracle.truffle.r.native/fficall/src/truffle_common/Rinternals_truffle_common.h b/com.oracle.truffle.r.native/fficall/src/truffle_common/Rinternals_truffle_common.h
index 809858dbd9..51579ad956 100644
--- a/com.oracle.truffle.r.native/fficall/src/truffle_common/Rinternals_truffle_common.h
+++ b/com.oracle.truffle.r.native/fficall/src/truffle_common/Rinternals_truffle_common.h
@@ -66,6 +66,15 @@
 
 #include <rffiutils.h>
 
+// these two functions are here just to handle casting void* to void function pointers...
+DL_FUNC R_ExternalPtrAddrFn(SEXP s) {
+    return (DL_FUNC) R_ExternalPtrAddr(s);
+}
+
+SEXP R_MakeExternalPtrFn(DL_FUNC p, SEXP tag, SEXP prot) {
+    return R_MakeExternalPtr((void *) p, tag, prot);
+}
+
 // R_GlobalEnv et al are not a variables in FASTR as they are RContext specific
 SEXP FASTR_R_GlobalEnv() {
     TRACE0();
@@ -1391,6 +1400,7 @@ SEXP R_MakeExternalPtr(void *p, SEXP tag, SEXP prot) {
 }
 
 void *R_ExternalPtrAddr(SEXP s) {
+
     TRACE0();
     SEXP result = ((call_R_ExternalPtrAddr) callbacks[R_ExternalPtrAddr_x])(s);
     checkExitCall();
diff --git a/com.oracle.truffle.r.native/version.source b/com.oracle.truffle.r.native/version.source
index 425151f3a4..87523dd7a0 100644
--- a/com.oracle.truffle.r.native/version.source
+++ b/com.oracle.truffle.r.native/version.source
@@ -1 +1 @@
-40
+41
-- 
GitLab