diff options
| author | Kylie McClain <somasis@exherbo.org> | 2015-11-05 16:59:29 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-11-19 20:23:55 +0000 |
| commit | 1ed66e9b6a5ff4f2b649e16777200d0b53270908 (patch) | |
| tree | 0a96511e9cc149490348e80dc69d8a7cfcc1db6b /src/backtrace.cc | |
| parent | 788c3587205280b008b3e918664436b31a9d7325 (diff) | |
Fix building with musl libc
Diffstat (limited to 'src/backtrace.cc')
| -rw-r--r-- | src/backtrace.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backtrace.cc b/src/backtrace.cc index adeb9301..677702c8 100644 --- a/src/backtrace.cc +++ b/src/backtrace.cc @@ -2,21 +2,24 @@ #include "string.hh" -#if defined(__linux__) || defined(__APPLE__) +#if defined(__GLIBC__) || defined(__APPLE__) # include <execinfo.h> -# include <stdlib.h> #elif defined(__CYGWIN__) # include <windows.h> # include <dbghelp.h> # include <stdio.h> #endif +#if defined(__linux__) || defined(__APPLE__) +# include <stdlib.h> +#endif + namespace Kakoune { Backtrace::Backtrace() { - #if defined(__linux__) || defined(__APPLE__) + #if defined(__GLIBC__) || defined(__APPLE__) num_frames = backtrace(stackframes, max_frames); #elif defined(__CYGWIN__) num_frames = CaptureStackBackTrace(0, max_frames, stackframes, nullptr); @@ -25,7 +28,7 @@ Backtrace::Backtrace() String Backtrace::desc() const { - #if defined(__linux__) || defined(__APPLE__) + #if defined(__GLIBC__) || defined(__APPLE__) char** symbols = backtrace_symbols(stackframes, num_frames); ByteCount size = 0; for (int i = 0; i < num_frames; ++i) |
