about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-02-11 14:02:17 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-02-11 14:02:17 -0800
commit5bcf2a921287cc9a07c413cfaae56ee349a305e1 (patch)
treedd967d7b1624c631a8a1a8ea432de7e5a82c74f6 /src/libstd
parent7362bd57a90fa4f9fe730bea5ec2713099a54082 (diff)
parent92b72222541a86adbadf6661cccc854f9e9cdb39 (diff)
downloadrust-5bcf2a921287cc9a07c413cfaae56ee349a305e1.tar.gz
rust-5bcf2a921287cc9a07c413cfaae56ee349a305e1.zip
rollup merge of #22177: semarie/openbsd-notls
OpenBSD doesn't have thread-local-storage support (yet).
Permit to compile (and run) `check-stage1-crates` under OpenBSD.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/thread_local/scoped.rs26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs
index 1a20612d60a..01220e7bc1f 100644
--- a/src/libstd/thread_local/scoped.rs
+++ b/src/libstd/thread_local/scoped.rs
@@ -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> =
@@ -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> =
@@ -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,
@@ -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;
 
@@ -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;