tss_esapi_sys/
lib.rs

1// Copyright 2021 Contributors to the Parsec project.
2// SPDX-License-Identifier: Apache-2.0
3#![allow(
4    non_snake_case,
5    non_camel_case_types,
6    non_upper_case_globals,
7    clippy::unseparated_literal_suffix,
8    improper_ctypes,
9    missing_debug_implementations,
10    trivial_casts,
11    clippy::all,
12    unused
13)]
14// Suppress warnings from bindgen-generated code
15// Remove on resolution of
16// https://github.com/rust-lang/rust-bindgen/issues/1651
17#![allow(deref_nullptr)]
18///! This crate provides a basic interface for accessing the TSS Enhanced
19///! System API from Rust. No abstraction is provided beyond what is
20///! automatically generated by `bindgen` - the `tss-esapi` crate is the
21///! one exposing an idiomatic Rust interface built on top of this FFI.
22
23// For supported targets: use the generated and committed bindings.
24#[cfg(all(
25    not(feature = "generate-bindings"),
26    target_arch = "x86_64",
27    target_os = "linux"
28))]
29include!(concat!(
30    env!("CARGO_MANIFEST_DIR"),
31    "/src/bindings/x86_64-unknown-linux-gnu.rs"
32));
33
34#[cfg(all(
35    not(feature = "generate-bindings"),
36    target_arch = "aarch64",
37    target_os = "linux"
38))]
39include!(concat!(
40    env!("CARGO_MANIFEST_DIR"),
41    "/src/bindings/aarch64-unknown-linux-gnu.rs"
42));
43
44#[cfg(all(
45    not(feature = "generate-bindings"),
46    target_arch = "arm",
47    target_os = "linux"
48))]
49include!(concat!(
50    env!("CARGO_MANIFEST_DIR"),
51    "/src/bindings/arm-unknown-linux-gnueabi.rs"
52));
53
54#[cfg(all(
55    not(feature = "generate-bindings"),
56    target_arch = "x86_64",
57    target_os = "macos"
58))]
59include!(concat!(
60    env!("CARGO_MANIFEST_DIR"),
61    "/src/bindings/x86_64-unknown-darwin.rs"
62));
63
64// If the "generate-bindings" feature is on, use the generated bindings.
65#[cfg(feature = "generate-bindings")]
66include!(concat!(env!("OUT_DIR"), "/tss_esapi_bindings.rs"));