Skip to content

Commit

Permalink
libstd: allow improper_ctypes in sys/sgx
Browse files Browse the repository at this point in the history
Signed-off-by: David Wood <david@davidtw.co>
  • Loading branch information
davidtwco committed Nov 5, 2019
1 parent 95c505d commit 49e2403
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libstd/sys/sgx/abi/mod.rs
Expand Up @@ -53,6 +53,7 @@ unsafe extern "C" fn tcs_init(secondary: bool) {
// (main function exists). If this is a library, the crate author should be
// able to specify this
#[cfg(not(test))]
#[allow(improper_ctypes)]
#[no_mangle]
extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64) -> (u64, u64) {
// FIXME: how to support TLS in library mode?
Expand Down
3 changes: 3 additions & 0 deletions src/libstd/sys/sgx/rwlock.rs
Expand Up @@ -172,6 +172,7 @@ const EINVAL: i32 = 22;

#[cfg(not(test))]
#[no_mangle]
#[allow(improper_ctypes)]
pub unsafe extern "C" fn __rust_rwlock_rdlock(p: *mut RWLock) -> i32 {
if p.is_null() {
return EINVAL;
Expand All @@ -181,6 +182,7 @@ pub unsafe extern "C" fn __rust_rwlock_rdlock(p: *mut RWLock) -> i32 {
}

#[cfg(not(test))]
#[allow(improper_ctypes)]
#[no_mangle]
pub unsafe extern "C" fn __rust_rwlock_wrlock(p: *mut RWLock) -> i32 {
if p.is_null() {
Expand All @@ -190,6 +192,7 @@ pub unsafe extern "C" fn __rust_rwlock_wrlock(p: *mut RWLock) -> i32 {
return 0;
}
#[cfg(not(test))]
#[allow(improper_ctypes)]
#[no_mangle]
pub unsafe extern "C" fn __rust_rwlock_unlock(p: *mut RWLock) -> i32 {
if p.is_null() {
Expand Down

0 comments on commit 49e2403

Please sign in to comment.