1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: do not use backtrace with musl

This commit is contained in:
Alexander Medvednikov 2019-10-25 18:38:47 +03:00
parent c7e6d379da
commit be0830b24f

View File

@ -39,8 +39,9 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) {
}
$if linux {
$if !android {
$if glibc {
// backtrace is not available on Android.
if C.backtrace_symbols_fd != 0 {
//if C.backtrace_symbols_fd != 0 {
buffer := [100]byteptr
nr_ptrs := C.backtrace(*voidptr(buffer), 100)
nr_actual_frames := nr_ptrs-skipframes
@ -70,7 +71,7 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) {
}
//C.backtrace_symbols_fd(*voidptr(&buffer[skipframes]), nr_actual_frames, 1)
return
}else{
}$else{
C.printf('backtrace_symbols_fd is missing, so printing backtraces is not available.\n')
C.printf('Some libc implementations like musl simply do not provide it.\n')
}