diff options
author | TBK <858296+TBK@users.noreply.github.com> | 2020-03-27 00:58:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 16:58:21 -0700 |
commit | 6382d6f5c9d4d149989e47b20446f794365137c1 (patch) | |
tree | 46bd308c5ca322c2f006b631696fd1a4a32a3d30 | |
parent | fe1838367d56a6f8fa7e1dd61c91afbd59406bd2 (diff) | |
download | libunwind-6382d6f5c9d4d149989e47b20446f794365137c1.tar.gz |
tests: fix test-coredump-unwind without HAVE_EXECINFO_H (#165)
-rw-r--r-- | tests/test-coredump-unwind.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c index 53498237..fb06a38e 100644 --- a/tests/test-coredump-unwind.c +++ b/tests/test-coredump-unwind.c @@ -57,7 +57,11 @@ #include <grp.h> /* For SIGSEGV handler code */ -#include <execinfo.h> +#if HAVE_EXECINFO_H +# include <execinfo.h> +#else + extern int backtrace (void **, int); +#endif #include <sys/ucontext.h> #include <libunwind-coredump.h> @@ -242,7 +246,7 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext) void *array[50]; int size; size = backtrace(array, 50); -#ifdef __linux__ +#if defined __linux__ && HAVE_EXECINFO_H backtrace_symbols_fd(array, size, 2); #endif } |