summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-06 15:29:17 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-06 15:29:17 -0800
commited61bd869300df56e52338ba1ee36038159ad196 (patch)
treeeae74dea46df0bcb5783fde35edac35afaca44e4 /src/libstd/sys
parentacc5d7914a5e287d0783f63dd316c3a25b976544 (diff)
parent134eb0e26f6c2d89b852995295d364614d6b7299 (diff)
downloadrust-ed61bd869300df56e52338ba1ee36038159ad196.tar.gz
rust-ed61bd869300df56e52338ba1ee36038159ad196.zip
rollup merge of #20652: vhbit/thread-key-type
This is a manual merge of #20627 and #20634 to avoid conflicts in rollup and also avoid one roundtrip. I've leave copyright to original author.  If this one is moved to rollup original PR could be closed. cc @mneumann

@alexcrichton r?

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.
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/thread_local.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libstd/sys/unix/thread_local.rs b/src/libstd/sys/unix/thread_local.rs
index e507377a8fc..ea1e9c261fe 100644
--- a/src/libstd/sys/unix/thread_local.rs
+++ b/src/libstd/sys/unix/thread_local.rs
@@ -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 {