Skip to content

Commit d286cb3

Browse files
authored
Update api.cpp for ANDROID
People are compiling Rcpp on Android so they can work on the bus (and the toilet): termux/termux-packages#250 (comment) 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
1 parent f1ec6cf commit d286cb3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ using namespace Rcpp;
3333
#endif
3434

3535
#if defined(__GNUC__) || defined(__clang__)
36-
#if defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__MUSL__) || defined(__HAIKU__)
36+
#if defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__MUSL__) || defined(__HAIKU__) || defined(__ANDROID__)
3737
// do nothing
3838
#else
3939
#include <execinfo.h>
@@ -272,14 +272,14 @@ SEXP rcpp_can_use_cxx11() { // #nocov start
272272
// [[Rcpp::register]]
273273
SEXP stack_trace(const char* file, int line) {
274274
#if defined(__GNUC__) || defined(__clang__)
275-
#if defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__MUSL__) || defined(__HAIKU__)
275+
#if defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__MUSL__) || defined(__HAIKU__) || defined(__ANDROID__)
276276
// Simpler version for Windows and *BSD
277277
List trace = List::create(_["file"] = file,
278278
_[ "line" ] = line,
279279
_[ "stack" ] = "C++ stack not available on this system");
280280
trace.attr("class") = "Rcpp_stack_trace";
281281
return trace;
282-
#else // ! (defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX)
282+
#else // ! (defined(_WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__sun) || defined(_AIX) || defined(__ANDROID__)
283283

284284
/* inspired from http://tombarta.wordpress.com/2008/08/01/c-stack-traces-with-gcc/ */
285285
const size_t max_depth = 100;

0 commit comments

Comments
 (0)