diff options
author | Noa <33094578+coolreader18@users.noreply.github.com> | 2021-11-01 19:58:12 -0500 |
---|---|---|
committer | Noa <33094578+coolreader18@users.noreply.github.com> | 2021-11-01 19:58:12 -0500 |
commit | cd57a938cfab04c38c38bb2d5d8be49238c3d43f (patch) | |
tree | d21431d5ad8cb2115cdda341daae5a3bcd58a35b /src/wasi.rs | |
parent | bbbb5d8b0d683a699fd33ff2e7b7e2a670002985 (diff) | |
download | rust-libc-cd57a938cfab04c38c38bb2d5d8be49238c3d43f.tar.gz |
Use ptr::addr_of when available
Diffstat (limited to 'src/wasi.rs')
-rw-r--r-- | src/wasi.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/wasi.rs b/src/wasi.rs index a41ec47696..7d49450d09 100644 --- a/src/wasi.rs +++ b/src/wasi.rs @@ -352,10 +352,12 @@ 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; -pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(&_CLOCK_MONOTONIC) }; -pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t = unsafe { clockid_t(&_CLOCK_PROCESS_CPUTIME_ID) }; -pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(&_CLOCK_REALTIME) }; -pub static CLOCK_THREAD_CPUTIME_ID: clockid_t = unsafe { clockid_t(&_CLOCK_THREAD_CPUTIME_ID) }; +pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) }; +pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t = + unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) }; +pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) }; +pub static CLOCK_THREAD_CPUTIME_ID: clockid_t = + unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) }; #[cfg_attr( feature = "rustc-dep-of-std", |