Skip to content

Commit

Permalink
openbsd don't support TLS
Browse files Browse the repository at this point in the history
  • Loading branch information
semarie committed Feb 11, 2015
1 parent 2067dd2 commit 92b7222
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/libstd/thread_local/scoped.rs
Expand Up @@ -81,6 +81,7 @@ macro_rules! __scoped_thread_local_inner {
#[cfg_attr(not(any(windows,
target_os = "android",
target_os = "ios",
target_os = "openbsd",
target_arch = "aarch64")),
thread_local)]
static $name: ::std::thread_local::scoped::Key<$t> =
Expand All @@ -90,6 +91,7 @@ macro_rules! __scoped_thread_local_inner {
#[cfg_attr(not(any(windows,
target_os = "android",
target_os = "ios",
target_os = "openbsd",
target_arch = "aarch64")),
thread_local)]
pub static $name: ::std::thread_local::scoped::Key<$t> =
Expand All @@ -98,14 +100,22 @@ macro_rules! __scoped_thread_local_inner {
($t:ty) => ({
use std::thread_local::scoped::Key as __Key;

#[cfg(not(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64")))]
#[cfg(not(any(windows,
target_os = "android",
target_os = "ios",
target_os = "openbsd",
target_arch = "aarch64")))]
const _INIT: __Key<$t> = __Key {
inner: ::std::thread_local::scoped::__impl::KeyInner {
inner: ::std::cell::UnsafeCell { value: 0 as *mut _ },
}
};

#[cfg(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64"))]
#[cfg(any(windows,
target_os = "android",
target_os = "ios",
target_os = "openbsd",
target_arch = "aarch64"))]
const _INIT: __Key<$t> = __Key {
inner: ::std::thread_local::scoped::__impl::KeyInner {
inner: ::std::thread_local::scoped::__impl::OS_INIT,
Expand Down Expand Up @@ -205,7 +215,11 @@ impl<T> Key<T> {
}
}

#[cfg(not(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64")))]
#[cfg(not(any(windows,
target_os = "android",
target_os = "ios",
target_os = "openbsd",
target_arch = "aarch64")))]
mod imp {
use std::cell::UnsafeCell;

Expand All @@ -223,7 +237,11 @@ mod imp {
}
}

#[cfg(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64"))]
#[cfg(any(windows,
target_os = "android",
target_os = "ios",
target_os = "openbsd",
target_arch = "aarch64"))]
mod imp {
use marker;
use sys_common::thread_local::StaticKey as OsStaticKey;
Expand Down

0 comments on commit 92b7222

Please sign in to comment.