Skip to content

Commit 2a984c9

Browse files
committed
auto merge of #10440 : brson/rust/cnamespace, r=bstrie
2 parents 7fc3e82 + f4c222f commit 2a984c9

File tree

9 files changed

+28
-28
lines changed

9 files changed

+28
-28
lines changed

src/libextra/time.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ pub mod rustrt {
2121
use super::Tm;
2222

2323
extern {
24-
pub fn get_time(sec: &mut i64, nsec: &mut i32);
25-
pub fn precise_time_ns(ns: &mut u64);
24+
pub fn rust_get_time(sec: &mut i64, nsec: &mut i32);
25+
pub fn rust_precise_time_ns(ns: &mut u64);
2626
pub fn rust_tzset();
2727
pub fn rust_gmtime(sec: i64, nsec: i32, result: &mut Tm);
2828
pub fn rust_localtime(sec: i64, nsec: i32, result: &mut Tm);
@@ -66,7 +66,7 @@ pub fn get_time() -> Timespec {
6666
unsafe {
6767
let mut sec = 0i64;
6868
let mut nsec = 0i32;
69-
rustrt::get_time(&mut sec, &mut nsec);
69+
rustrt::rust_get_time(&mut sec, &mut nsec);
7070
return Timespec::new(sec, nsec);
7171
}
7272
}
@@ -79,7 +79,7 @@ pub fn get_time() -> Timespec {
7979
pub fn precise_time_ns() -> u64 {
8080
unsafe {
8181
let mut ns = 0u64;
82-
rustrt::precise_time_ns(&mut ns);
82+
rustrt::rust_precise_time_ns(&mut ns);
8383
ns
8484
}
8585
}

src/libstd/rt/basic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ impl Drop for BasicPausible {
241241

242242
fn time() -> Time {
243243
extern {
244-
fn get_time(sec: &mut i64, nsec: &mut i32);
244+
fn rust_get_time(sec: &mut i64, nsec: &mut i32);
245245
}
246246
let mut sec = 0;
247247
let mut nsec = 0;
248-
unsafe { get_time(&mut sec, &mut nsec) }
248+
unsafe { rust_get_time(&mut sec, &mut nsec) }
249249

250250
Time { sec: sec as u64, nsec: nsec as u64 }
251251
}

src/libstd/rt/context.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl Context {
5959
// which we will then modify to call the given function when restored
6060
let mut regs = new_regs();
6161
unsafe {
62-
swap_registers(transmute_mut_region(&mut *regs), transmute_region(&*regs));
62+
rust_swap_registers(transmute_mut_region(&mut *regs), transmute_region(&*regs));
6363
};
6464

6565
initialize_call_frame(&mut *regs, fp, argp, sp);
@@ -104,22 +104,22 @@ impl Context {
104104
// stack limit in the OS-specified TLS slot. This also means that
105105
// we cannot call any more rust functions after record_stack_bounds
106106
// returns because they would all likely fail due to the limit being
107-
// invalid for the current task. Lucky for us `swap_registers` is a
108-
// C function so we don't have to worry about that!
107+
// invalid for the current task. Lucky for us `rust_swap_registers`
108+
// is a C function so we don't have to worry about that!
109109
match in_context.stack_bounds {
110110
Some((lo, hi)) => record_stack_bounds(lo, hi),
111111
// If we're going back to one of the original contexts or
112112
// something that's possibly not a "normal task", then reset
113113
// the stack limit to 0 to make morestack never fail
114114
None => record_stack_bounds(0, uint::max_value),
115115
}
116-
swap_registers(out_regs, in_regs)
116+
rust_swap_registers(out_regs, in_regs)
117117
}
118118
}
119119
}
120120

121121
extern {
122-
fn swap_registers(out_regs: *mut Registers, in_regs: *Registers);
122+
fn rust_swap_registers(out_regs: *mut Registers, in_regs: *Registers);
123123
}
124124

125125
// Register contexts used in various architectures
@@ -142,7 +142,7 @@ extern {
142142
//
143143
// These structures/functions are roughly in-sync with the source files inside
144144
// of src/rt/arch/$arch. The only currently used function from those folders is
145-
// the `swap_registers` function, but that's only because for now segmented
145+
// the `rust_swap_registers` function, but that's only because for now segmented
146146
// stacks are disabled.
147147

148148
#[cfg(target_arch = "x86")]

src/rt/arch/arm/_context.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
.align
1313
#endif
1414

15-
.globl swap_registers
16-
swap_registers:
15+
.globl rust_swap_registers
16+
rust_swap_registers:
1717
str r0, [r0, #0]
1818
str r3, [r0, #12]
1919
str r4, [r0, #16]

src/rt/arch/i386/_context.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ The registers_t variable is in (%esp)
2121
*/
2222

2323
#if defined(__APPLE__) || defined(_WIN32)
24-
#define SWAP_REGISTERS _swap_registers
24+
#define SWAP_REGISTERS _rust_swap_registers
2525
#else
26-
#define SWAP_REGISTERS swap_registers
26+
#define SWAP_REGISTERS rust_swap_registers
2727
#endif
2828

2929
// swap_registers(registers_t *oregs, registers_t *regs)

src/rt/arch/mips/_context.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#endif
55

66
.text
7-
.globl swap_registers
7+
.globl rust_swap_registers
88
.align 2
99
.set nomips16
10-
.ent swap_registers
11-
swap_registers:
10+
.ent rust_swap_registers
11+
rust_swap_registers:
1212
.set noreorder
1313
.set nomacro
1414
.set noat
@@ -85,4 +85,4 @@ swap_registers:
8585

8686
jr $31
8787
nop
88-
.end swap_registers
88+
.end rust_swap_registers

src/rt/arch/x86_64/_context.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ First four arguments:
5555
*/
5656

5757
#if defined(__APPLE__)
58-
#define SWAP_REGISTERS _swap_registers
58+
#define SWAP_REGISTERS _rust_swap_registers
5959
#else
60-
#define SWAP_REGISTERS swap_registers
60+
#define SWAP_REGISTERS rust_swap_registers
6161
#endif
6262

6363
// swap_registers(registers_t *oregs, registers_t *regs)

src/rt/rust_builtin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ extern "C" CDECL FILE* rust_get_stderr() {return stderr;}
168168

169169
#if defined(__WIN32__)
170170
extern "C" CDECL void
171-
get_time(int64_t *sec, int32_t *nsec) {
171+
rust_get_time(int64_t *sec, int32_t *nsec) {
172172
FILETIME fileTime;
173173
GetSystemTimeAsFileTime(&fileTime);
174174

@@ -187,7 +187,7 @@ get_time(int64_t *sec, int32_t *nsec) {
187187
}
188188
#else
189189
extern "C" CDECL void
190-
get_time(int64_t *sec, int32_t *nsec) {
190+
rust_get_time(int64_t *sec, int32_t *nsec) {
191191
#ifdef __APPLE__
192192
struct timeval tv;
193193
gettimeofday(&tv, NULL);
@@ -205,7 +205,7 @@ get_time(int64_t *sec, int32_t *nsec) {
205205
const int64_t ns_per_s = 1000000000LL;
206206

207207
extern "C" CDECL void
208-
precise_time_ns(uint64_t *ns) {
208+
rust_precise_time_ns(uint64_t *ns) {
209209

210210
#ifdef __APPLE__
211211
uint64_t time = mach_absolute_time();

src/rt/rustrt.def.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ rust_dbg_abi_1
22
rust_dbg_abi_2
33
rust_dbg_static_mut
44
rust_dbg_static_mut_check_four
5-
get_time
5+
rust_get_time
66
rust_tzset
77
rust_gmtime
88
rust_localtime
99
rust_timegm
1010
rust_mktime
11-
precise_time_ns
11+
rust_precise_time_ns
1212
rust_path_is_dir
1313
rust_path_is_dir_u16
1414
rust_path_exists
@@ -43,7 +43,7 @@ rust_signal_little_lock
4343
rust_wait_little_lock
4444
tdefl_compress_mem_to_heap
4545
tinfl_decompress_mem_to_heap
46-
swap_registers
46+
rust_swap_registers
4747
rust_readdir
4848
rust_opendir
4949
rust_dbg_extern_identity_u32

0 commit comments

Comments
 (0)