~leon_plickat/wat

dc70c1eca7e58e111b86e1d81fc9ce8a741bec9b — Leon Henrik Plickat a month ago 5ee1e61 master
Only include execinfo.h when glibc is used
1 files changed, 5 insertions(+), 0 deletions(-)

M wat.c
M wat.c => wat.c +5 -0
@@ 28,8 28,11 @@
#include <unistd.h>

#ifdef __linux__
#include <features.h>
#ifdef __GLIBC__
#include<execinfo.h>
#endif
#endif

#include <wayland-client.h>



@@ 172,6 175,7 @@ static void handle_error (int signum)
	fputs(msg, stderr);

#ifdef __linux__
#ifdef __GLIBC__
	fputs("Attempting to get backtrace:\n", stderr);

	/* In some rare cases, getting a backtrace can also cause a segfault.


@@ 183,6 187,7 @@ static void handle_error (int signum)
	backtrace_symbols_fd(buffer, calls, fileno(stderr));
	fputs("\n", stderr);
#endif
#endif

	/* Let the default handlers deal with the rest. */
	signal(signum, SIG_DFL);