diff --git a/NEWS.md b/NEWS.md index ae52d697..39f3d4c1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # cpp11 (development version) +* `R_NO_REMAP` and `STRICT_R_HEADERS` are now conditionally defined only if they + have not already been defined elsewhere. This is motivated by the fact that + `R_NO_REMAP` is becoming the default for C++ code in R 4.5.0 (#410). + * Because cpp11 now requires R >=4.0.0 and `R_UnwindProtect()` is always available, `HAS_UNWIND_PROTECT` is no longer useful. Please avoid using it, as we'd like to remove it in the future (#411). diff --git a/inst/include/cpp11/R.hpp b/inst/include/cpp11/R.hpp index e461298f..01dbad0b 100644 --- a/inst/include/cpp11/R.hpp +++ b/inst/include/cpp11/R.hpp @@ -8,8 +8,14 @@ #endif #endif +#ifndef R_NO_REMAP #define R_NO_REMAP +#endif + +#ifndef STRICT_R_HEADERS #define STRICT_R_HEADERS +#endif + #include "R_ext/Boolean.h" #include "Rinternals.h" #include "Rversion.h"