diff --git a/runng-sys/tests/tests.rs b/runng-sys/tests/tests.rs index 0af57928..ea0e376d 100644 --- a/runng-sys/tests/tests.rs +++ b/runng-sys/tests/tests.rs @@ -8,7 +8,7 @@ mod tests { fn it_works() { unsafe { let url = CString::new("inproc://test").unwrap(); - let url = url.as_bytes_with_nul().as_ptr() as *const i8; + let url = url.as_bytes_with_nul().as_ptr() as *const std::os::raw::c_char; // Reply socket let mut rep_socket = nng_socket { id: 0 }; diff --git a/runng/src/lib.rs b/runng/src/lib.rs index 453488c3..2a078382 100644 --- a/runng/src/lib.rs +++ b/runng/src/lib.rs @@ -96,8 +96,10 @@ trait InternalSocket { } // Return string and pointer so string isn't dropped -fn to_cstr(string: &str) -> Result<(std::ffi::CString, *const i8), std::ffi::NulError> { +fn to_cstr( + string: &str, +) -> Result<(std::ffi::CString, *const std::os::raw::c_char), std::ffi::NulError> { let string = std::ffi::CString::new(string)?; - let ptr = string.as_bytes_with_nul().as_ptr() as *const i8; + let ptr = string.as_bytes_with_nul().as_ptr() as *const std::os::raw::c_char; Ok((string, ptr)) }