tools: hscollider FTBS in alpine linux

alpine uses musl instead of glibc and therefore doesn't have backtrace()
as part of its libc.

POSIX mandates that _exit() be defined through unistd.h which used to be
included together with execinfo.h when backtrace() was detected and
therefore it happened to build fine for linux or freebsd (when using
libexecinfo from the system or ports).

since there was a macro already defined to test for unistd.h use that
instead and decouple this dependency, so that the code could be built
even when no backtrace() is provided (as expected also in OpenBSD)
This commit is contained in:
Carlo Marcelo Arenas Belón 2019-06-03 15:32:38 -07:00 committed by Chang, Harry
parent f28feee57d
commit 7ea4e06275

View File

@ -42,7 +42,10 @@
#ifdef HAVE_BACKTRACE #ifdef HAVE_BACKTRACE
#include <execinfo.h> #include <execinfo.h>
#include <unistd.h> #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h> // for _exit
#endif #endif
#define BACKTRACE_BUFFER_SIZE 200 #define BACKTRACE_BUFFER_SIZE 200