Skip to content

Commit 7167ed1

Browse files
authored
apacheGH-44924: [R] Remove usage of cpp11's HAS_UNWIND_PROTECT (apache#45261)
### Rationale for this change The macro is no longer required on R >= 4.0 which is our minimum version. ### What changes are included in this PR? Remove use of HAS_UNWIND_PROTECT ### Are these changes tested? ci ### Are there any user-facing changes? no * GitHub Issue: apache#44924 Authored-by: Jacob Wujciak-Jens <[email protected]> Signed-off-by: Jacob Wujciak-Jens <[email protected]>
1 parent 3712a59 commit 7167ed1

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

Diff for: r/src/safe-call-into-r-impl.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ bool SetEnableSignalStopSource(bool enabled) {
4646

4747
// [[arrow::export]]
4848
bool CanRunWithCapturedR() {
49-
#if defined(HAS_UNWIND_PROTECT)
5049
return MainRThread::GetInstance().Executor() == nullptr;
51-
#else
52-
return false;
53-
#endif
5450
}
5551

5652
// [[arrow::export]]

Diff for: r/src/safe-call-into-r.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@
2929
#include <functional>
3030
#include <thread>
3131

32-
// Unwind protection was added in R 3.5 and some calls here use it
33-
// and crash R in older versions (ARROW-16201). Implementation provided
34-
// in safe-call-into-r-impl.cpp so that we can skip some tests
35-
// when this feature is not provided. This also checks that there
36-
// is not already an event loop registered (via MainRThread::Executor()),
37-
// because only one of these can exist at any given time.
32+
// This checks that there is not already an event loop registered (via
33+
// MainRThread::Executor()), because only one of these can exist at any given time.
3834
bool CanRunWithCapturedR();
3935

4036
// The MainRThread class keeps track of the thread on which it is safe

0 commit comments

Comments
 (0)