Tuning pthread_key_t type

Both FreeBSD and DragonFly define pthread_key_t as int, while Linux
defines it as uint. As pthread_key_t is used as an opaque type and
storage size of both int and uint are the same, this is rather a
cosmetic change.

iOS uses ulong (as OS X) so difference is critical on 64bit platforms.
This commit is contained in:
Michael Neumann 2015-01-06 10:53:32 +01:00 committed by Valerii Hiora
parent 8efd9901b6
commit 134eb0e26f
1 changed files with 10 additions and 2 deletions

View File

@ -37,10 +37,18 @@ pub unsafe fn destroy(key: Key) {
debug_assert_eq!(r, 0);
}
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos",
target_os = "ios"))]
type pthread_key_t = ::libc::c_ulong;
#[cfg(not(target_os = "macos"))]
#[cfg(any(target_os = "freebsd",
target_os = "dragonfly"))]
type pthread_key_t = ::libc::c_int;
#[cfg(not(any(target_os = "macos",
target_os = "ios",
target_os = "freebsd",
target_os = "dragonfly")))]
type pthread_key_t = ::libc::c_uint;
extern {