-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add HermitCore support even if it doesn't have a UNIX interface #1292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
92b24f5
add HermitCore support even if it doesn't have a UNIX interface
stlankes 6e95369
Merge remote-tracking branch 'rustlang/master'
stlankes 585d45a
remove redefinition of c_char and w_char, remove typo
stlankes 682b8af
add target "hermit" to build.sh
stlankes 52bb152
allowd unused types ggid_t and uuid_t
stlankes cab10b4
add missing traits like Debug
stlankes be35992
add missing debug trait for sockaddr_storage
stlankes 5d18556
remove unused variables
stlankes 14353e8
remove obsolete definition of gid_t and uid_t
stlankes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub type c_char = u8; | ||
pub type wchar_t = u32; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// libc port for HermitCore (https://hermitcore.org) | ||
// | ||
// Ported by Colin Fink <[email protected]> | ||
// and Stefan Lankes <[email protected]> | ||
|
||
pub type int8_t = i8; | ||
pub type int16_t = i16; | ||
pub type int32_t = i32; | ||
pub type int64_t = i64; | ||
pub type uint8_t = u8; | ||
pub type uint16_t = u16; | ||
pub type uint32_t = u32; | ||
pub type uint64_t = u64; | ||
|
||
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::*; | ||
gnzlbg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} 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, | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub type c_char = i8; | ||
pub type wchar_t = i32; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.