Skip to content

Commit 928b122

Browse files
committed
add compatibility re-maps for EXTPTR_PTR and ENCLOS in JRI
1 parent 1652926 commit 928b122

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

jri/src/Rengine.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ LibExtern int R_interrupts_pending;
2121
#define RS_ParseVector(A,B,C) R_ParseVector(A,B,C,R_NilValue)
2222
#endif
2323

24+
/* R API compatibility re-mapping */
25+
#if (R_VERSION >= R_Version(2,0,0))
26+
/* EXTPTR */
27+
#ifdef EXTPTR_PTR
28+
#undef EXTPTR_PTR
29+
#endif
30+
#define EXTPTR_PTR(X) R_ExternalPtrAddr(X)
31+
#endif
32+
33+
#if (R_VERSION >= R_Version(2,5,0))
34+
#ifdef ENCLOS
35+
#undef ENCLOS
36+
#endif
37+
#define ENCLOS(X) R_ParentEnv(X)
38+
#endif
39+
2440
#include "Rcallbacks.h"
2541
#include "Rinit.h"
2642
#include "globals.h"

0 commit comments

Comments
 (0)