about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-05-25 21:43:22 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2021-03-05 21:32:49 +0100
commit1122f42e2872a4bb65adeb990fb73cc555f5c3cf (patch)
treed3bdf04621c949445f036c2f3e35aa2205675c99 /example
parentc825bc8e61c9a30adebacbe87d048324a5e1063a (diff)
downloadrust-1122f42e2872a4bb65adeb990fb73cc555f5c3cf.tar.gz
rust-1122f42e2872a4bb65adeb990fb73cc555f5c3cf.zip
Support cross-compiling to Windows using MinGW
Diffstat (limited to 'example')
-rw-r--r--example/mini_core.rs1
-rw-r--r--example/mini_core_hello_world.rs4
-rw-r--r--example/std_example.rs3
3 files changed, 5 insertions, 3 deletions
diff --git a/example/mini_core.rs b/example/mini_core.rs
index 7c6d7fc106d..c4834c80408 100644
--- a/example/mini_core.rs
+++ b/example/mini_core.rs
@@ -621,6 +621,7 @@ struct PanicLocation {
 }
 
 #[no_mangle]
+#[cfg(not(windows))]
 pub fn get_tls() -> u8 {
     #[thread_local]
     static A: u8 = 42;
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index 237f4d11d57..08ceaeb6544 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -239,7 +239,7 @@ fn main() {
 
     assert_eq!(((|()| 42u8) as fn(()) -> u8)(()), 42);
 
-    #[cfg(not(jit))]
+    #[cfg(not(any(jit, windows)))]
     {
         extern {
             #[linkage = "extern_weak"]
@@ -292,7 +292,7 @@ fn main() {
 
     from_decimal_string();
 
-    #[cfg(not(jit))]
+    #[cfg(not(any(jit, windows)))]
     test_tls();
 
     #[cfg(all(not(jit), target_os = "linux"))]
diff --git a/example/std_example.rs b/example/std_example.rs
index 015bbdfed46..221b512e3bd 100644
--- a/example/std_example.rs
+++ b/example/std_example.rs
@@ -16,7 +16,8 @@ fn main() {
     let mut stderr = stderr.lock();
 
     // FIXME support lazy jit when multi threading
-    #[cfg(not(lazy_jit))]
+    // FIXME support TLS on windows
+    #[cfg(not(any(lazy_jit, windows)))]
     std::thread::spawn(move || {
         println!("Hello from another thread!");
     });