mirror of
https://git.sr.ht/~leon_plickat/wlopm
synced 2024-11-16 02:18:25 +01:00
Only include execinfo.h when glibc is used
This commit is contained in:
parent
c61cbb4573
commit
06ae5c5f6e
5
wlopm.c
5
wlopm.c
@ -28,8 +28,11 @@
|
||||
#include <wayland-client.h>
|
||||
|
||||
#ifdef __linux__
|
||||
#include <features.h>
|
||||
#ifdef __GLIBC__
|
||||
#include<execinfo.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "xdg-output-unstable-v1.h"
|
||||
#include "wlr-output-power-management-unstable-v1.h"
|
||||
@ -432,6 +435,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.
|
||||
@ -442,6 +446,7 @@ static void handle_error (int signum)
|
||||
const int calls = backtrace(buffer, sizeof(buffer) / sizeof(void *));
|
||||
backtrace_symbols_fd(buffer, calls, fileno(stderr));
|
||||
fputs("\n", stderr);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Let the default handlers deal with the rest. */
|
||||
|
Loading…
Reference in New Issue
Block a user