Update to ndk 0.7 and ndk-sys 0.4

This commit is contained in:
Robert Bragg
2022-08-11 03:32:28 +01:00
parent 73a1acb3c7
commit 7a49db4d61
3 changed files with 15 additions and 17 deletions
+3 -5
View File
@@ -24,11 +24,9 @@ native-activity = []
[dependencies]
log = "0.4"
jni-sys = "0.3"
# Coordinate the next winit release with android-ndk-rs: https://github.com/rust-windowing/winit/issues/1995
ndk = { git = "https://github.com/rust-windowing/android-ndk-rs", rev = "7e33384" }
ndk-sys = { git = "https://github.com/rust-windowing/android-ndk-rs", rev = "7e33384" }
#ndk-sys = { version = "0.3" }
ndk-context = { version = "0.1" }
ndk = "0.7"
ndk-sys = "0.4"
ndk-context = "0.1"
android-properties = "0.2"
num_enum = "0.5"
bitflags = "1.3"
+6 -6
View File
@@ -500,14 +500,14 @@ pub unsafe extern "C" fn GameActivity_onCreate(
fn android_log(level: Level, tag: &CStr, msg: &CStr) {
let prio = match level {
Level::Error => ndk_sys::android_LogPriority_ANDROID_LOG_ERROR,
Level::Warn => ndk_sys::android_LogPriority_ANDROID_LOG_WARN,
Level::Info => ndk_sys::android_LogPriority_ANDROID_LOG_INFO,
Level::Debug => ndk_sys::android_LogPriority_ANDROID_LOG_DEBUG,
Level::Trace => ndk_sys::android_LogPriority_ANDROID_LOG_VERBOSE,
Level::Error => ndk_sys::android_LogPriority::ANDROID_LOG_ERROR,
Level::Warn => ndk_sys::android_LogPriority::ANDROID_LOG_WARN,
Level::Info => ndk_sys::android_LogPriority::ANDROID_LOG_INFO,
Level::Debug => ndk_sys::android_LogPriority::ANDROID_LOG_DEBUG,
Level::Trace => ndk_sys::android_LogPriority::ANDROID_LOG_VERBOSE,
};
unsafe {
ndk_sys::__android_log_write(prio as raw::c_int, tag.as_ptr(), msg.as_ptr());
ndk_sys::__android_log_write(prio.0 as raw::c_int, tag.as_ptr(), msg.as_ptr());
}
}
+6 -6
View File
@@ -418,14 +418,14 @@ unsafe extern "C" fn ANativeActivity_onCreate(
fn android_log(level: Level, tag: &CStr, msg: &CStr) {
let prio = match level {
Level::Error => ndk_sys::android_LogPriority_ANDROID_LOG_ERROR,
Level::Warn => ndk_sys::android_LogPriority_ANDROID_LOG_WARN,
Level::Info => ndk_sys::android_LogPriority_ANDROID_LOG_INFO,
Level::Debug => ndk_sys::android_LogPriority_ANDROID_LOG_DEBUG,
Level::Trace => ndk_sys::android_LogPriority_ANDROID_LOG_VERBOSE,
Level::Error => ndk_sys::android_LogPriority::ANDROID_LOG_ERROR,
Level::Warn => ndk_sys::android_LogPriority::ANDROID_LOG_WARN,
Level::Info => ndk_sys::android_LogPriority::ANDROID_LOG_INFO,
Level::Debug => ndk_sys::android_LogPriority::ANDROID_LOG_DEBUG,
Level::Trace => ndk_sys::android_LogPriority::ANDROID_LOG_VERBOSE,
};
unsafe {
ndk_sys::__android_log_write(prio as raw::c_int, tag.as_ptr(), msg.as_ptr());
ndk_sys::__android_log_write(prio.0 as raw::c_int, tag.as_ptr(), msg.as_ptr());
}
}