Skip to content

Commit

Permalink
addr_of!(EXTERN_STATIC) is now considered safe
Browse files Browse the repository at this point in the history
  • Loading branch information
joboet committed Jul 29, 2024
1 parent f16089a commit 1b092dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,14 @@ pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
pub const _SC_IOV_MAX: c_int = 60;
pub const _SC_SYMLOOP_MAX: c_int = 173;

#[allow(unused_unsafe)] // `addr_of!(EXTERN_STATIC)` is now considered safe
pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
#[allow(unused_unsafe)]
pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
#[allow(unused_unsafe)]
pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
#[allow(unused_unsafe)]
pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };

Expand Down

0 comments on commit 1b092dc

Please sign in to comment.