// 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],
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);
//
// 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;