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:
parent
a45895a3af
commit
9158ba4640
@ -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')
|
||||
|
@ -539,6 +539,9 @@ pub fn user_os() string {
|
||||
$if msvc {
|
||||
return 'windows'
|
||||
}
|
||||
$if android{
|
||||
return 'android'
|
||||
}
|
||||
return 'unknown'
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user