]> git.lizzy.rs Git - rust.git/commitdiff
[emscripten] Disable code paths that don't work on emscripten
authorJan-Erik Rediger <janerik@fnordig.de>
Mon, 8 Aug 2016 23:41:51 +0000 (01:41 +0200)
committerJan-Erik Rediger <janerik@fnordig.de>
Wed, 10 Aug 2016 14:39:32 +0000 (16:39 +0200)
src/libstd/sys/unix/mod.rs
src/libstd/sys/unix/os.rs
src/libstd/sys/unix/thread.rs
src/libunwind/libunwind.rs
src/test/run-pass/intrinsic-alignment.rs
src/test/run-pass/rec-align-u64.rs

index 1c25c8f77c196f444489178e37a471c67cdb3947..23687e10e476d40de9750064d09ded52a0624369 100644 (file)
@@ -83,11 +83,11 @@ fn oom_handler() -> ! {
         }
     }
 
-    #[cfg(not(target_os = "nacl"))]
+    #[cfg(not(any(target_os = "nacl", target_os = "emscripten")))]
     unsafe fn reset_sigpipe() {
         assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != !0);
     }
-    #[cfg(target_os = "nacl")]
+    #[cfg(any(target_os = "nacl", target_os = "emscripten"))]
     unsafe fn reset_sigpipe() {}
 }
 
index 9c57f25dfcce8eb65585d51fa42d06459f114f94..c29e87f91c9a7e247471f2c4749e3264e663d572 100644 (file)
@@ -551,11 +551,13 @@ pub fn home_dir() -> Option<PathBuf> {
 
     #[cfg(any(target_os = "android",
               target_os = "ios",
-              target_os = "nacl"))]
+              target_os = "nacl",
+              target_os = "emscripten"))]
     unsafe fn fallback() -> Option<OsString> { None }
     #[cfg(not(any(target_os = "android",
                   target_os = "ios",
-                  target_os = "nacl")))]
+                  target_os = "nacl",
+                  target_os = "emscripten")))]
     unsafe fn fallback() -> Option<OsString> {
         #[cfg(not(target_os = "solaris"))]
         unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
index 1061ca87f6470894dda944ed69fb36d5e5ac75dc..75e10d2585308cecb85d17e374fff32c0842509f 100644 (file)
@@ -81,8 +81,7 @@ pub fn yield_now() {
     }
 
     #[cfg(any(target_os = "linux",
-              target_os = "android",
-              target_os = "emscripten"))]
+              target_os = "android"))]
     pub fn set_name(name: &CStr) {
         const PR_SET_NAME: libc::c_int = 15;
         // pthread wrapper only appeared in glibc 2.12, so we use syscall
@@ -118,9 +117,9 @@ pub fn set_name(name: &CStr) {
                                      name.as_ptr() as *mut libc::c_void);
         }
     }
-    #[cfg(any(target_env = "newlib", target_os = "solaris"))]
+    #[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
     pub fn set_name(_name: &CStr) {
-        // Newlib and Illumos has no way to set a thread name.
+        // Newlib, Illumos and Emscripten have no way to set a thread name.
     }
 
     pub fn sleep(dur: Duration) {
index 5e242db0a888db8c1dbd41c6aafb58ef9d27c196..680ad3ecd64a6c156cb65fce6d67a90e08be4d8e 100644 (file)
@@ -60,7 +60,6 @@ pub enum _Unwind_Reason_Code {
 pub const unwinder_private_data_size: usize = 2;
 
 #[cfg(target_arch = "asmjs")]
-// FIXME: Copied from arm. Need to confirm.
 pub const unwinder_private_data_size: usize = 20;
 
 #[repr(C)]
index f1e4f8dfa8c83e60201e52ed07247c19d6afe195..cfae9903a95e5ecd5204d7254228ee7f245319a7 100644 (file)
@@ -24,7 +24,8 @@ mod rusti {
           target_os = "dragonfly",
           target_os = "netbsd",
           target_os = "openbsd",
-          target_os = "solaris"))]
+          target_os = "solaris",
+          target_os = "emscripten"))]
 mod m {
     #[main]
     #[cfg(target_arch = "x86")]
index 2161864f0b69654fc1de16eb4f694763f45ab239..4863979b3f6c2bdd0731cc40add9a6cdd0f416d5 100644 (file)
@@ -42,7 +42,8 @@ struct Outer {
           target_os = "dragonfly",
           target_os = "netbsd",
           target_os = "openbsd",
-          target_os = "solaris"))]
+          target_os = "solaris",
+          target_os = "emscripten"))]
 mod m {
     #[cfg(target_arch = "x86")]
     pub mod m {