diff --git a/wlopm.c b/wlopm.c index 69f5602..41ece7d 100644 --- a/wlopm.c +++ b/wlopm.c @@ -28,8 +28,11 @@ #include #ifdef __linux__ +#include +#ifdef __GLIBC__ #include #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. */