1#![crate_name = "libc"]
3#![crate_type = "rlib"]
4#![allow(
5 renamed_and_removed_lints, unknown_lints, nonstandard_style,
8 overflowing_literals,
9 unused_macros,
10 unused_macro_rules,
11)]
12#![warn(
13 missing_copy_implementations,
14 missing_debug_implementations,
15 safe_packed_borrows
16)]
17#![warn(rust_2024_compatibility)]
19#![allow(
21 missing_unsafe_on_extern,
22 edition_2024_expr_fragment_specifier,
23 unsafe_op_in_unsafe_fn
25)]
26#![cfg_attr(libc_deny_warnings, deny(warnings))]
27#![cfg_attr(feature = "rustc-dep-of-std", feature(link_cfg, no_core))]
29#![cfg_attr(libc_thread_local, feature(thread_local))]
30#![cfg_attr(feature = "rustc-dep-of-std", allow(internal_features))]
31#![cfg_attr(feature = "rustc-dep-of-std", allow(static_mut_refs))]
33#![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)]
34#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
35
36#[macro_use]
37mod macros;
38mod new;
39
40cfg_if! {
41 if #[cfg(feature = "rustc-dep-of-std")] {
42 extern crate rustc_std_workspace_core as core;
43 }
44}
45
46pub use core::ffi::c_void;
47
48#[allow(unused_imports)] pub use new::*;
50
51cfg_if! {
52 if #[cfg(windows)] {
53 mod primitives;
54 pub use crate::primitives::*;
55
56 mod windows;
57 pub use crate::windows::*;
58
59 prelude!();
60 } else if #[cfg(target_os = "fuchsia")] {
61 mod primitives;
62 pub use crate::primitives::*;
63
64 mod fuchsia;
65 pub use crate::fuchsia::*;
66
67 prelude!();
68 } else if #[cfg(target_os = "switch")] {
69 mod primitives;
70 pub use primitives::*;
71
72 mod switch;
73 pub use switch::*;
74
75 prelude!();
76 } else if #[cfg(target_os = "psp")] {
77 mod primitives;
78 pub use primitives::*;
79
80 mod psp;
81 pub use crate::psp::*;
82
83 prelude!();
84 } else if #[cfg(target_os = "vxworks")] {
85 mod primitives;
86 pub use crate::primitives::*;
87
88 mod vxworks;
89 pub use crate::vxworks::*;
90
91 prelude!();
92 } else if #[cfg(target_os = "solid_asp3")] {
93 mod primitives;
94 pub use crate::primitives::*;
95
96 mod solid;
97 pub use crate::solid::*;
98
99 prelude!();
100 } else if #[cfg(unix)] {
101 mod primitives;
102 pub use crate::primitives::*;
103
104 mod unix;
105 pub use crate::unix::*;
106
107 mod types {
use core::mem::MaybeUninit;
use crate::prelude::*;
#[allow(unused)]
#[repr(transparent)]
pub(crate) struct Padding<T: Copy>(MaybeUninit<T>);
#[automatically_derived]
#[allow(unused)]
impl<T: ::core::clone::Clone + Copy> ::core::clone::Clone for Padding<T> {
#[inline]
fn clone(&self) -> Padding<T> {
Padding(::core::clone::Clone::clone(&self.0))
}
}
#[automatically_derived]
#[allow(unused)]
impl<T: ::core::marker::Copy + Copy> ::core::marker::Copy for Padding<T> {
}
impl<T: Copy> Default for Padding<T> {
fn default() -> Self { Self(MaybeUninit::zeroed()) }
}
impl<T: Copy> fmt::Debug for Padding<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let full_name = core::any::type_name::<Self>();
let prefix_len = full_name.find("Padding").unwrap();
f.pad(&full_name[prefix_len..])
}
}
#[allow(unused)]
pub(crate) type CEnumRepr = c_uint;
}
mod prelude {
#[allow(unused_imports)]
pub(crate) use core::clone::Clone;
#[allow(unused_imports)]
pub(crate) use core::default::Default;
#[allow(unused_imports)]
pub(crate) use core::marker::{Copy, Send, Sync};
#[allow(unused_imports)]
pub(crate) use core::option::Option;
#[allow(unused_imports)]
pub(crate) use core::prelude::v1::derive;
#[allow(unused_imports)]
pub(crate) use core::{fmt, hash, iter, mem, ptr};
#[allow(unused_imports)]
pub(crate) use fmt::Debug;
#[allow(unused_imports)]
pub(crate) use mem::{align_of, align_of_val, size_of, size_of_val};
#[allow(unused_imports)]
pub(crate) use crate::types::{CEnumRepr, Padding};
#[allow(unused_imports)]
pub(crate) use crate::{
c_char, c_double, c_float, c_int, c_long, c_longlong, c_short,
c_uchar, c_uint, c_ulong, c_ulonglong, c_ushort, c_void, intptr_t,
size_t, ssize_t, uintptr_t,
};
}prelude!();
108 } else if #[cfg(target_os = "hermit")] {
109 mod primitives;
110 pub use crate::primitives::*;
111
112 mod hermit;
113 pub use crate::hermit::*;
114
115 prelude!();
116 } else if #[cfg(target_os = "teeos")] {
117 mod primitives;
118 pub use primitives::*;
119
120 mod teeos;
121 pub use teeos::*;
122
123 prelude!();
124 } else if #[cfg(target_os = "trusty")] {
125 mod primitives;
126 pub use crate::primitives::*;
127
128 mod trusty;
129 pub use crate::trusty::*;
130
131 prelude!();
132 } else if #[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] {
133 mod primitives;
134 pub use crate::primitives::*;
135
136 mod sgx;
137 pub use crate::sgx::*;
138
139 prelude!();
140 } else if #[cfg(any(target_env = "wasi", target_os = "wasi"))] {
141 mod primitives;
142 pub use crate::primitives::*;
143
144 mod wasi;
145 pub use crate::wasi::*;
146
147 prelude!();
148 } else if #[cfg(target_os = "xous")] {
149 mod primitives;
150 pub use crate::primitives::*;
151
152 mod xous;
153 pub use crate::xous::*;
154
155 prelude!();
156 } else {
157 }
159}