android_ndk_sys/
lib.rs

1//! Raw FFI bindings to the Android NDK.
2//!
3//! The bindings are pre-generated and the right one for the platform is selected at compile time.
4//!
5//! If you are including `android_native_app_glue.c`, the [`android_native_app_glue`
6//! module](android_native_app_glue/index.html) contains the interface for that.
7
8// Bindgen lints
9#![allow(non_upper_case_globals)]
10#![allow(non_camel_case_types)]
11#![allow(non_snake_case)]
12#![allow(improper_ctypes)]
13// Test setup lints
14#![cfg_attr(test, allow(dead_code))]
15
16pub mod native_app_glue;
17
18#[cfg(all(not(target_os = "android"), not(test), not(feature = "rustdoc")))]
19compile_error!("android-ndk-sys only supports compiling for Android");
20
21#[cfg(any(
22    all(any(target_os = "android", test), target_arch = "arm"),
23    feature = "rustdoc"
24))]
25include!("ffi_arm.rs");
26
27#[cfg(all(any(target_os = "android", test), target_arch = "armv7"))]
28include!("ffi_armv7.rs");
29
30#[cfg(all(any(target_os = "android", test), target_arch = "aarch64"))]
31include!("ffi_aarch64.rs");
32
33#[cfg(all(any(target_os = "android", test), target_arch = "x86"))]
34include!("ffi_i686.rs");
35
36#[cfg(all(any(target_os = "android", test), target_arch = "x86_64"))]
37include!("ffi_x86_64.rs");