Skip to content

Commit efbb15d

Browse files
committed
Fix libgreen
1 parent c4e0755 commit efbb15d

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/libgreen/context.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,27 +188,27 @@ fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
188188

189189
// windows requires saving more registers (both general and XMM), so the windows
190190
// register context must be larger.
191-
#[cfg(windows, target_arch = "x86_64")]
191+
#[cfg(all(windows, target_arch = "x86_64"))]
192192
#[repr(C)]
193193
struct Registers {
194194
gpr:[libc::uintptr_t, ..14],
195195
_xmm:[simd::u32x4, ..10]
196196
}
197-
#[cfg(not(windows), target_arch = "x86_64")]
197+
#[cfg(all(not(windows), target_arch = "x86_64"))]
198198
#[repr(C)]
199199
struct Registers {
200200
gpr:[libc::uintptr_t, ..10],
201201
_xmm:[simd::u32x4, ..6]
202202
}
203203

204-
#[cfg(windows, target_arch = "x86_64")]
204+
#[cfg(all(windows, target_arch = "x86_64"))]
205205
fn new_regs() -> Box<Registers> {
206206
box() Registers {
207207
gpr:[0,..14],
208208
_xmm:[simd::u32x4(0,0,0,0),..10]
209209
}
210210
}
211-
#[cfg(not(windows), target_arch = "x86_64")]
211+
#[cfg(all(not(windows), target_arch = "x86_64"))]
212212
fn new_regs() -> Box<Registers> {
213213
box() Registers {
214214
gpr:[0,..10],
@@ -288,16 +288,13 @@ fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
288288
regs[14] = rust_bootstrap_green_task as libc::uintptr_t; // #56 pc, r14 --> lr
289289
}
290290

291-
#[cfg(target_arch = "mips")]
292-
#[cfg(target_arch = "mipsel")]
291+
#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
293292
type Registers = [libc::uintptr_t, ..32];
294293

295-
#[cfg(target_arch = "mips")]
296-
#[cfg(target_arch = "mipsel")]
294+
#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
297295
fn new_regs() -> Box<Registers> { box {[0, .. 32]} }
298296

299-
#[cfg(target_arch = "mips")]
300-
#[cfg(target_arch = "mipsel")]
297+
#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
301298
fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
302299
procedure: raw::Procedure, sp: *mut uint) {
303300
let sp = align_down(sp);

src/libgreen/stack.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ pub struct Stack {
2828
//
2929
// DragonFly BSD also seems to suffer from the same problem. When MAP_STACK is
3030
// used, it returns the same `ptr` multiple times.
31-
#[cfg(not(windows), not(target_os = "freebsd"), not(target_os = "dragonfly"))]
31+
#[cfg(not(any(windows, target_os = "freebsd", target_os = "dragonfly")))]
3232
static STACK_FLAGS: libc::c_int = libc::MAP_STACK | libc::MAP_PRIVATE |
3333
libc::MAP_ANON;
34-
#[cfg(target_os = "freebsd")]
35-
#[cfg(target_os = "dragonfly")]
34+
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
3635
static STACK_FLAGS: libc::c_int = libc::MAP_PRIVATE | libc::MAP_ANON;
3736
#[cfg(windows)]
3837
static STACK_FLAGS: libc::c_int = 0;

0 commit comments

Comments
 (0)