Skip to content

Commit 7bd8045

Browse files
committed
Combine current and previous approaches finding execinfo.h
1 parent bbbc018 commit 7bd8045

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2026-01-12 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/include/Rcpp/exceptions_impl.h: Combine previous and current
4+
methods enabling when 'execinfo.h' is found on selected platforms
5+
16
2026-01-08 Dirk Eddelbuettel <edd@debian.org>
27

38
* DESCRIPTION (Date, Version): Release 1.1.1

inst/include/Rcpp/exceptions_impl.h

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Copyright (C) 2012 - 2019 Dirk Eddelbuettel and Romain Francois
44
// 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
66
//
77
// This file is part of Rcpp.
88
//
@@ -23,15 +23,33 @@
2323
#define Rcpp__exceptions_impl__h
2424

2525
// enable demangler on platforms where execinfo.h is present
26+
// and that are not actively blacklisted
2627
#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
3352
# endif
34-
# endif
3553
#endif
3654

3755
namespace Rcpp {

0 commit comments

Comments
 (0)