]> git.lizzy.rs Git - rust.git/commitdiff
Fix libgreen
authorSteven Fackler <sfackler@gmail.com>
Mon, 29 Sep 2014 07:28:41 +0000 (00:28 -0700)
committerSteven Fackler <sfackler@palantir.com>
Tue, 30 Sep 2014 19:52:47 +0000 (12:52 -0700)
src/libgreen/context.rs
src/libgreen/stack.rs

index 296615e15ffa065cc1081035dfbff1e806a4697c..a665d41aadf96531ec64a067366fb98358201547 100644 (file)
@@ -188,27 +188,27 @@ fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
 
 // windows requires saving more registers (both general and XMM), so the windows
 // register context must be larger.
-#[cfg(windows, target_arch = "x86_64")]
+#[cfg(all(windows, target_arch = "x86_64"))]
 #[repr(C)]
 struct Registers {
     gpr:[libc::uintptr_t, ..14],
     _xmm:[simd::u32x4, ..10]
 }
-#[cfg(not(windows), target_arch = "x86_64")]
+#[cfg(all(not(windows), target_arch = "x86_64"))]
 #[repr(C)]
 struct Registers {
     gpr:[libc::uintptr_t, ..10],
     _xmm:[simd::u32x4, ..6]
 }
 
-#[cfg(windows, target_arch = "x86_64")]
+#[cfg(all(windows, target_arch = "x86_64"))]
 fn new_regs() -> Box<Registers> {
     box() Registers {
         gpr:[0,..14],
         _xmm:[simd::u32x4(0,0,0,0),..10]
     }
 }
-#[cfg(not(windows), target_arch = "x86_64")]
+#[cfg(all(not(windows), target_arch = "x86_64"))]
 fn new_regs() -> Box<Registers> {
     box() Registers {
         gpr:[0,..10],
@@ -288,16 +288,13 @@ fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
     regs[14] = rust_bootstrap_green_task as libc::uintptr_t;   // #56 pc, r14 --> lr
 }
 
-#[cfg(target_arch = "mips")]
-#[cfg(target_arch = "mipsel")]
+#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
 type Registers = [libc::uintptr_t, ..32];
 
-#[cfg(target_arch = "mips")]
-#[cfg(target_arch = "mipsel")]
+#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
 fn new_regs() -> Box<Registers> { box {[0, .. 32]} }
 
-#[cfg(target_arch = "mips")]
-#[cfg(target_arch = "mipsel")]
+#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
 fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
                          procedure: raw::Procedure, sp: *mut uint) {
     let sp = align_down(sp);
index 4673e7b3ba2092b318b807fe42f140528ebae3fd..23b41f6c6e75bc2a8c2d1c83a1d5b140d1caae0a 100644 (file)
@@ -28,11 +28,10 @@ pub struct Stack {
 //
 // DragonFly BSD also seems to suffer from the same problem. When MAP_STACK is
 // used, it returns the same `ptr` multiple times.
-#[cfg(not(windows), not(target_os = "freebsd"), not(target_os = "dragonfly"))]
+#[cfg(not(any(windows, target_os = "freebsd", target_os = "dragonfly")))]
 static STACK_FLAGS: libc::c_int = libc::MAP_STACK | libc::MAP_PRIVATE |
                                   libc::MAP_ANON;
-#[cfg(target_os = "freebsd")]
-#[cfg(target_os = "dragonfly")]
+#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
 static STACK_FLAGS: libc::c_int = libc::MAP_PRIVATE | libc::MAP_ANON;
 #[cfg(windows)]
 static STACK_FLAGS: libc::c_int = 0;