|
2 | 2 | // |
3 | 3 | // Copyright (C) 2012 - 2019 Dirk Eddelbuettel and Romain Francois |
4 | 4 | // Copyright (C) 2020 - 2024 Dirk Eddelbuettel, Romain Francois, and Joshua N. Pritikin |
5 | | -// Copyright (C) 2025 Dirk Eddelbuettel, Romain Francois, Joshua N. Pritikin, and Iñaki Ucar |
| 5 | +// Copyright (C) 2025 - 2026 Dirk Eddelbuettel, Romain Francois, Joshua N. Pritikin, and Iñaki Ucar |
6 | 6 | // |
7 | 7 | // This file is part of Rcpp. |
8 | 8 | // |
|
23 | 23 | #define Rcpp__exceptions_impl__h |
24 | 24 |
|
25 | 25 | // enable demangler on platforms where execinfo.h is present |
| 26 | +// and that are not actively blacklisted |
26 | 27 | #ifndef RCPP_DEMANGLER_ENABLED |
27 | | -# define RCPP_DEMANGLER_ENABLED 0 |
28 | | -# if defined __has_include |
29 | | -# if __has_include (<execinfo.h>) |
30 | | -# include <execinfo.h> |
31 | | -# undef RCPP_DEMANGLER_ENABLED |
32 | | -# define RCPP_DEMANGLER_ENABLED 1 |
| 28 | +// set a fallback default |
| 29 | +#define RCPP_DEMANGLER_ENABLED 0 |
| 30 | +# if defined(_WIN32) || \ |
| 31 | + defined(__FreeBSD__) || \ |
| 32 | + defined(__NetBSD__) || \ |
| 33 | + defined(__OpenBSD__) || \ |
| 34 | + defined(__DragonFly__) || \ |
| 35 | + defined(__CYGWIN__) || \ |
| 36 | + defined(__sun) || \ |
| 37 | + defined(_AIX) || \ |
| 38 | + defined(__MUSL__) || \ |
| 39 | + defined(__HAIKU__) || \ |
| 40 | + defined(__ANDROID__) |
| 41 | +// nothing to do here so just redefining |
| 42 | +# undef RCPP_DEMANGLER_ENABLED |
| 43 | +# define RCPP_DEMANGLER_ENABLED 0 |
| 44 | +# elif defined __has_include |
| 45 | +// if we can test for headers |
| 46 | +# if __has_include (<execinfo.h>) |
| 47 | +// if we have the header, include and use it |
| 48 | +# include <execinfo.h> |
| 49 | +# undef RCPP_DEMANGLER_ENABLED |
| 50 | +# define RCPP_DEMANGLER_ENABLED 1 |
| 51 | +# endif |
33 | 52 | # endif |
34 | | -# endif |
35 | 53 | #endif |
36 | 54 |
|
37 | 55 | namespace Rcpp { |
|
0 commit comments