|
1 | 1 | // exceptions_impl.h: Rcpp R/C++ interface class library -- exceptions |
2 | 2 | // |
3 | 3 | // Copyright (C) 2012 - 2019 Dirk Eddelbuettel and Romain Francois |
4 | | -// Copyright (C) 2020 Dirk Eddelbuettel, Romain Francois, and Joshua N. Pritikin |
| 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 | 6 | // |
6 | 7 | // This file is part of Rcpp. |
7 | 8 | // |
|
21 | 22 | #ifndef Rcpp__exceptions_impl__h |
22 | 23 | #define Rcpp__exceptions_impl__h |
23 | 24 |
|
24 | | -// disable demangler on platforms where we have no support |
| 25 | +// enable demangler on platforms where execinfo.h is present |
25 | 26 | #ifndef RCPP_DEMANGLER_ENABLED |
26 | | -# if defined(_WIN32) || \ |
27 | | - defined(__FreeBSD__) || \ |
28 | | - defined(__NetBSD__) || \ |
29 | | - defined(__OpenBSD__) || \ |
30 | | - defined(__DragonFly__) || \ |
31 | | - defined(__CYGWIN__) || \ |
32 | | - defined(__sun) || \ |
33 | | - defined(_AIX) || \ |
34 | | - defined(__MUSL__) || \ |
35 | | - defined(__HAIKU__) || \ |
36 | | - defined(__ANDROID__) |
37 | | -# define RCPP_DEMANGLER_ENABLED 0 |
38 | | -# elif defined(__GNUC__) || defined(__clang__) |
39 | | -# include <execinfo.h> |
40 | | -# define RCPP_DEMANGLER_ENABLED 1 |
41 | | -# else |
42 | | -# define RCPP_DEMANGLER_ENABLED 0 |
| 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 |
| 33 | +# endif |
43 | 34 | # endif |
44 | 35 | #endif |
45 | 36 |
|
|
0 commit comments