diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/libc/src/hermit | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/libc/src/hermit')
-rw-r--r-- | third_party/rust/libc/src/hermit/aarch64.rs | 2 | ||||
-rw-r--r-- | third_party/rust/libc/src/hermit/mod.rs | 64 | ||||
-rw-r--r-- | third_party/rust/libc/src/hermit/x86_64.rs | 2 |
3 files changed, 68 insertions, 0 deletions
diff --git a/third_party/rust/libc/src/hermit/aarch64.rs b/third_party/rust/libc/src/hermit/aarch64.rs new file mode 100644 index 0000000000..1a92e3b4fa --- /dev/null +++ b/third_party/rust/libc/src/hermit/aarch64.rs @@ -0,0 +1,2 @@ +pub type c_char = u8; +pub type wchar_t = u32; diff --git a/third_party/rust/libc/src/hermit/mod.rs b/third_party/rust/libc/src/hermit/mod.rs new file mode 100644 index 0000000000..bffcefdd89 --- /dev/null +++ b/third_party/rust/libc/src/hermit/mod.rs @@ -0,0 +1,64 @@ +// libc port for HermitCore (https://hermitcore.org) +// +// Ported by Colin Fink <colin.finck@rwth-aachen.de> +// and Stefan Lankes <slankes@eonerc.rwth-aachen.de> + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type size_t = usize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; +pub type uintptr_t = usize; +pub type ssize_t = isize; + +pub type c_long = i64; +pub type c_ulong = u64; + +pub type wint_t = u32; +pub type wctype_t = i64; + +pub type regoff_t = size_t; +pub type off_t = c_long; + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else { + // Unknown target_arch + } +} + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} diff --git a/third_party/rust/libc/src/hermit/x86_64.rs b/third_party/rust/libc/src/hermit/x86_64.rs new file mode 100644 index 0000000000..76ec3ce823 --- /dev/null +++ b/third_party/rust/libc/src/hermit/x86_64.rs @@ -0,0 +1,2 @@ +pub type c_char = i8; +pub type wchar_t = i32; |