From d286cb35627e779ba761b4f58b6863d6eb7d1110 Mon Sep 17 00:00:00 2001 From: Kendon Bell Date: Sun, 7 Jan 2018 09:21:02 +1300 Subject: [PATCH] Update api.cpp for ANDROID People are compiling Rcpp on Android so they can work on the bus (and the toilet): https://github.com/termux/termux-packages/issues/250#issuecomment-302719003 This patch should help with install Rcpp on that platform. Credit @its-pointless: https://github.com/its-pointless/gcc_termux/blob/master/R-patches/Rcpp/api.cpp.patch --- src/api.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api.cpp b/src/api.cpp index 28527d9ee..68324ce41 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -33,7 +33,7 @@ using namespace Rcpp; #endif #if defined(__GNUC__) || defined(__clang__) - #if defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__MUSL__) || defined(__HAIKU__) + #if defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__MUSL__) || defined(__HAIKU__) || defined(__ANDROID__) // do nothing #else #include @@ -272,14 +272,14 @@ SEXP rcpp_can_use_cxx11() { // #nocov start // [[Rcpp::register]] SEXP stack_trace(const char* file, int line) { #if defined(__GNUC__) || defined(__clang__) - #if defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__MUSL__) || defined(__HAIKU__) + #if defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__MUSL__) || defined(__HAIKU__) || defined(__ANDROID__) // Simpler version for Windows and *BSD List trace = List::create(_["file"] = file, _[ "line" ] = line, _[ "stack" ] = "C++ stack not available on this system"); trace.attr("class") = "Rcpp_stack_trace"; return trace; - #else // ! (defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) + #else // ! (defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__ANDROID__) /* inspired from http://tombarta.wordpress.com/2008/08/01/c-stack-traces-with-gcc/ */ const size_t max_depth = 100;