paleolimbot commented on code in PR #13397:
URL: https://github.com/apache/arrow/pull/13397#discussion_r918197947


##########
r/src/safe-call-into-r.h:
##########
@@ -20,18 +20,25 @@
 
 #include "./arrow_types.h"
 
+#include <arrow/io/interfaces.h>
 #include <arrow/util/future.h>
 #include <arrow/util/thread_pool.h>
 
 #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). We use this define
-// to make sure we don't crash on R 3.4 and lower.
+// and crash R in older versions (ARROW-16201). Crashes also occur
+// on 32-bit R builds on R 3.6 and lower.
+static inline bool CanSafeCallIntoR() {
 #if defined(HAS_UNWIND_PROTECT)
-#define HAS_SAFE_CALL_INTO_R
+  cpp11::function on_old_windows_fun = 
cpp11::package("arrow")["on_old_windows"];
+  bool on_old_windows = on_old_windows_fun();

Review Comment:
   That's a great idea...Done!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to