1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC

// Warn to use feature generate_bindings if building on a platform where prebuilt-bindings
// aren't available
#[cfg(all(not(feature = "bindgen"), not_pregenerated))]
compile_error!("Prebuilt-bindings aren't available. Turn on feature generate_bindings to build.");

#[cfg(all(feature = "generate_bindings", feature = "internal_generate"))]
compile_error!(
    "internal_generate is only for internal usage and does not work with the generate_bindings feature."
);

macro_rules! use_bindings {
    ($bindings:ident) => {
        mod $bindings;
        pub use $bindings::*;
    };
}

#[cfg(linux_x86_bindings)]
use_bindings!(linux_x86_bindings);

#[cfg(linux_x86_64_bindings)]
use_bindings!(linux_x86_64_bindings);

#[cfg(linux_aarch64_bindings)]
use_bindings!(linux_aarch64_bindings);

#[cfg(macos_x86_64_bindings)]
use_bindings!(macos_x86_64_bindings);

#[cfg(any(feature = "bindgen", not_pregenerated))]
use_bindings!(bindings);

#[allow(non_snake_case)]
/// # Safety
///
/// No special precaution required to call this method.
pub unsafe fn ERR_GET_LIB(packed_error: u32) -> i32 {
    ERR_GET_LIB_RUST(packed_error)
}

#[allow(non_snake_case)]
/// # Safety
///
/// No special precaution required to call this method.
pub unsafe fn ERR_GET_REASON(packed_error: u32) -> i32 {
    ERR_GET_REASON_RUST(packed_error)
}

#[allow(non_snake_case)]
/// # Safety
///
/// No special precaution required to call this method.
pub unsafe fn ERR_GET_FUNC(packed_error: u32) -> i32 {
    ERR_GET_FUNC_RUST(packed_error)
}