-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
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 | match unsafe { setpriority(c_which as u32, who as id_t, priority) } {
| ^^^^^^^^^^^^^^ expected i32, found u32
error[E0308]: mismatched types
--> src/resource.rs:50:41
|
50 | let priority = unsafe { getpriority(c_which as u32, who as id_t) };
| ^^^^^^^^^^^^^^ expected i32, found u32
error: aborting due to 2 previous errorsLooking 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].
Jille
Metadata
Metadata
Assignees
Labels
No labels