Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ndk-glue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ pub const NDK_GLUE_LOOPER_INPUT_QUEUE_IDENT: i32 = 1;

pub 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());
}
}

Expand Down
2 changes: 1 addition & 1 deletion ndk-sys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Unreleased

- **Breaking:** Turn `enum` type aliases into newtype wrappers. (#245)
- **Breaking:** Turn `enum` type aliases into newtype wrappers. (#245, #315)

# 0.3.0 (2022-01-05)

Expand Down
37 changes: 36 additions & 1 deletion ndk-sys/generate_bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,46 @@ while read ARCH && read TARGET ; do
--blocklist-item '_?JavaVM' \
--blocklist-item '_?j\w+' \
--newtype-enum '\w+_(result|status)_t' \
--newtype-enum 'AndroidBitmapFormat' \
--newtype-enum 'ACameraDevice_request_template' \
--newtype-enum 'ADataSpace' \
--newtype-enum 'AHardwareBuffer_Format' \
--newtype-enum 'AHardwareBuffer_UsageFlags' \
--newtype-enum 'AHdrMetadataType' \
--newtype-enum 'AIMAGE_FORMATS' \
--newtype-enum 'AMediaDrmEventType' \
--newtype-enum 'AMediaDrmKeyType' \
--newtype-enum 'AMediaKeyStatusType' \
--newtype-enum 'ANativeWindowTransform' \
--newtype-enum 'ANativeWindow_ChangeFrameRateStrategy' \
--newtype-enum 'ANativeWindow_FrameRateCompatibility' \
--newtype-enum 'ANativeWindow_LegacyFormat' \
--newtype-enum 'AndroidBitmapCompressFormat' \
--newtype-enum 'AndroidBitmapFormat' \
--newtype-enum 'AppendMode' \
--newtype-enum 'DeviceTypeCode' \
--newtype-enum 'DurationCode' \
--newtype-enum 'FeatureLevelCode' \
--newtype-enum 'FuseCode' \
--newtype-enum 'HeapTaggingLevel' \
--newtype-enum 'OperandCode' \
--newtype-enum 'OperationCode' \
--newtype-enum 'OutputFormat' \
--newtype-enum 'PaddingCode' \
--newtype-enum 'PreferenceCode' \
--newtype-enum 'PriorityCode' \
--newtype-enum 'ResNsendFlags' \
--newtype-enum 'ResultCode' \
--newtype-enum 'SeekMode' \
--newtype-enum 'acamera_\w+' \
--newtype-enum 'android_LogPriority' \
--newtype-enum 'android_fdsan_error_level' \
--newtype-enum 'android_fdsan_owner_type' \
--newtype-enum 'cryptoinfo_mode_t' \
--newtype-enum 'log_id' \
-- \
--sysroot="${ANDROID_NDK_ROOT}"/toolchains/llvm/prebuilt/linux-x86_64/sysroot/ --target=$TARGET

# --newtype-enum '_bindgen_ty_63' \
done << EOF
arm
arm-linux-androideabi
Expand Down
Loading