diff --git a/src/sem.rs b/src/sem.rs index 22a462f..6f5c0f8 100644 --- a/src/sem.rs +++ b/src/sem.rs @@ -1,3 +1,5 @@ +use std::os::raw::c_long; + use ffi::*; use {IntoTimeout, WaitTimeout}; @@ -18,7 +20,7 @@ impl Semaphore { /// Passing a value greater than zero is useful for managing a finite pool of resources, /// where the pool size is equal to the value. pub fn new(n: u64) -> Self { - let ptr = unsafe { dispatch_semaphore_create(n as i64) }; + let ptr = unsafe { dispatch_semaphore_create(n as c_long) }; Semaphore { ptr } }