diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index 686f4bca93..f1000ad8d0 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -27,14 +27,17 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) { return } $if linux { - if C.backtrace_symbols_fd != 0 { - buffer := [100]byteptr - nr_ptrs := C.backtrace(*voidptr(buffer), 100) - C.backtrace_symbols_fd(&buffer[skipframes], nr_ptrs-skipframes, 1) - return - }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') + $if !android { + // backtrace is not available on Android. + if C.backtrace_symbols_fd != 0 { + buffer := [100]byteptr + nr_ptrs := C.backtrace(*voidptr(buffer), 100) + C.backtrace_symbols_fd(&buffer[skipframes], nr_ptrs-skipframes, 1) + return + }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') + } } } println('print_backtrace_skipping_top_frames is not implemented on this platform for now...\n') diff --git a/vlib/os/os.v b/vlib/os/os.v index 547495115a..f8e09411a6 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -539,6 +539,9 @@ pub fn user_os() string { $if msvc { return 'windows' } + $if android{ + return 'android' + } return 'unknown' }