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

vlib: add Android checks to build V on Android

This commit is contained in:
hazohelet 2019-09-17 00:23:11 +09:00 committed by Alexander Medvednikov
parent a45895a3af
commit 9158ba4640
2 changed files with 14 additions and 8 deletions

View File

@ -27,6 +27,8 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) {
return return
} }
$if linux { $if linux {
$if !android {
// backtrace is not available on Android.
if C.backtrace_symbols_fd != 0 { if C.backtrace_symbols_fd != 0 {
buffer := [100]byteptr buffer := [100]byteptr
nr_ptrs := C.backtrace(*voidptr(buffer), 100) nr_ptrs := C.backtrace(*voidptr(buffer), 100)
@ -37,6 +39,7 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) {
C.printf('Some libc implementations like musl simply do not provide it.\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') println('print_backtrace_skipping_top_frames is not implemented on this platform for now...\n')
} }
pub fn print_backtrace(){ pub fn print_backtrace(){

View File

@ -539,6 +539,9 @@ pub fn user_os() string {
$if msvc { $if msvc {
return 'windows' return 'windows'
} }
$if android{
return 'android'
}
return 'unknown' return 'unknown'
} }