Skip to content

Commit

Permalink
GH-44924: [R] Remove usage of cpp11's HAS_UNWIND_PROTECT (#45261)
Browse files Browse the repository at this point in the history
### 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: #44924

Authored-by: Jacob Wujciak-Jens <jacob@wujciak.de>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
  • Loading branch information
assignUser authored Feb 19, 2025
1 parent 3712a59 commit 7167ed1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 0 additions & 4 deletions r/src/safe-call-into-r-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ bool SetEnableSignalStopSource(bool enabled) {

// [[arrow::export]]
bool CanRunWithCapturedR() {
#if defined(HAS_UNWIND_PROTECT)
return MainRThread::GetInstance().Executor() == nullptr;
#else
return false;
#endif
}

// [[arrow::export]]
Expand Down
8 changes: 2 additions & 6 deletions r/src/safe-call-into-r.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@
#include <functional>
#include <thread>

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

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

0 comments on commit 7167ed1

Please sign in to comment.