libftd2xx_ffi/
lib.rs

1//! Rust FFI bindings to the [FTDI D2XX drivers](https://www.ftdichip.com/Drivers/D2XX.htm).
2#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
3#![allow(clippy::all, clippy::pedantic, clippy::nursery)]
4
5cfg_if::cfg_if! {
6    if #[cfg(feature = "bindgen")] {
7        include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
8    } else if #[cfg(all(target_os = "linux", target_arch = "x86_64"))] {
9        include!("bindings_linux_x64.rs");
10    } else if #[cfg(all(target_os = "linux", target_arch = "x86"))] {
11        include!("bindings_linux_x86.rs");
12    } else if #[cfg(all(target_os = "windows", target_arch = "x86_64"))] {
13        include!("bindings_windows_x64.rs");
14    } else if #[cfg(all(target_os = "windows", target_arch = "x86"))] {
15        include!("bindings_windows_x86.rs");
16    } else if #[cfg(all(target_os = "windows", target_arch = "aarch64"))] {
17        include!("bindings_windows_arm64.rs");
18    } else if #[cfg(all(target_os = "linux", target_arch = "arm"))] {
19        include!("bindings_linux_armv6.rs");
20    } else if #[cfg(all(target_os = "linux", target_arch = "aarch64"))] {
21        include!("bindings_linux_armv8.rs");
22    } else if #[cfg(all(target_os = "macos", target_arch = "x86_64"))] {
23        include!("bindings_macos_x64.rs");
24    } else if #[cfg(all(target_os = "macos", target_arch = "aarch64"))] {
25        include!("bindings_macos_aarch64.rs");
26    } else {
27        std::compile_error!("pre-generated bindings are not avaliable for your target");
28    }
29}