File tree Expand file tree Collapse file tree 1 file changed +0
-16
lines changed
Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change 1313#include " R_ext/Error.h" // for Rf_error, Rf_warning
1414#include " R_ext/Print.h" // for REprintf
1515#include " R_ext/Utils.h" // for R_CheckUserInterrupt
16- #include " Rversion.h" // for R_VERSION, R_Version
17-
18- #if defined(R_VERSION) && R_VERSION >= R_Version(3, 5, 0)
19- #define HAS_UNWIND_PROTECT
20- #endif
2116
2217#ifdef CPP11_USE_FMT
2318#define FMT_HEADER_ONLY
@@ -31,8 +26,6 @@ class unwind_exception : public std::exception {
3126 unwind_exception (SEXP token_) : token(token_) {}
3227};
3328
34- #ifdef HAS_UNWIND_PROTECT
35-
3629// / Unwind Protection from C longjmp's, like those used in R error handling
3730// /
3831// / @param code The code to which needs to be protected, as a nullary callable
@@ -95,15 +88,6 @@ unwind_protect(Fun&& code) {
9588 return out;
9689}
9790
98- #else
99- // Don't do anything if we don't have unwind protect. This will leak C++ resources,
100- // including those held by cpp11 objects, but the other alternatives are also not great.
101- template <typename Fun>
102- decltype (std::declval<Fun&&>()()) unwind_protect(Fun&& code) {
103- return std::forward<Fun>(code)();
104- }
105- #endif
106-
10791namespace detail {
10892
10993template <size_t ...>
You can’t perform that action at this time.
0 commit comments