mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-11-28 23:21:46 -05:00
minor android fixes
This commit is contained in:
parent
40660c6b33
commit
0b587e8f04
2 changed files with 5 additions and 2 deletions
|
|
@ -132,7 +132,9 @@ fn fix_android_emulator() {
|
||||||
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
|
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
|
||||||
if target_arch == "x86_64" && target_os == "android" {
|
if target_arch == "x86_64" && target_os == "android" {
|
||||||
let missing_library = "clang_rt.builtins-x86_64-android";
|
let missing_library = "clang_rt.builtins-x86_64-android";
|
||||||
let android_home = env::var("ANDROID_HOME").expect("ANDROID_HOME not set");
|
let android_home = env::var("ANDROID_HOME")
|
||||||
|
.or(env::var("ANDROID_SDK_ROOT"))
|
||||||
|
.expect("ANDROID_HOME or ANDROID_SDK_ROOT not set");
|
||||||
let lib_path = glob(&format!(
|
let lib_path = glob(&format!(
|
||||||
"{android_home}/ndk/25.1.8937393/**/lib{missing_library}.a"
|
"{android_home}/ndk/25.1.8937393/**/lib{missing_library}.a"
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ cfg_if! {
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::os::raw::{c_char, c_int};
|
use std::os::raw::c_int;
|
||||||
use tools::*;
|
use tools::*;
|
||||||
|
|
||||||
fn get_interface_name(index: u32) -> io::Result<String> {
|
fn get_interface_name(index: u32) -> io::Result<String> {
|
||||||
|
|
@ -37,6 +37,7 @@ fn get_interface_name(index: u32) -> io::Result<String> {
|
||||||
bail_io_error_other!("if_indextoname returned null");
|
bail_io_error_other!("if_indextoname returned null");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
use std::os::raw::c_char;
|
||||||
if unsafe { if_indextoname(index, ifnamebuf.as_mut_ptr() as *mut c_char) }.is_null() {
|
if unsafe { if_indextoname(index, ifnamebuf.as_mut_ptr() as *mut c_char) }.is_null() {
|
||||||
bail_io_error_other!("if_indextoname returned null");
|
bail_io_error_other!("if_indextoname returned null");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue