You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to compile on the latest nightly (or stable) on macOS with the latest libc I get the following errors
Compiling scheduler v0.1.3(file:///Users/bemeurer/src/rust-scheduler)
error[E0308]: mismatched types
--> src/resource.rs:30:32
|
30 | matchunsafe{setpriority(c_which asu32, who asid_t, priority)}{
| ^^^^^^^^^^^^^^ expected i32, found u32
error[E0308]: mismatched types
--> src/resource.rs:50:41
|
50 | let priority = unsafe{getpriority(c_which asu32, who asid_t)};
| ^^^^^^^^^^^^^^ expected i32, found u32
error: aborting due to 2 previous errors
Looking at the libc docs for both setpriority() and getpriority() we find that they both take an __priority_which_t, which is an alias to c_uint, which in turn is an alias to u32. All this indicates that the current calls are correct, and in that line the project compiles fine on Linux; just not on macOS, which seemingly expects an i32 there.
The only fix I can think of is conditional compilation through #[cfg].
The text was updated successfully, but these errors were encountered:
lovesegfault
changed the title
Calls to setpriority and getpriority has incorrect types
Calls to setpriority and getpriority have incorrect types on macOS
Jul 25, 2018
When trying to compile on the latest nightly (or stable) on macOS with the latest libc I get the following errors
Looking at the libc docs for both setpriority() and getpriority() we find that they both take an
__priority_which_t
, which is an alias toc_uint
, which in turn is an alias tou32
. All this indicates that the current calls are correct, and in that line the project compiles fine on Linux; just not on macOS, which seemingly expects an i32 there.The only fix I can think of is conditional compilation through
#[cfg]
.The text was updated successfully, but these errors were encountered: