diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2012-04-02 20:38:43 -0700 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2012-04-03 22:43:08 -0700 |
| commit | 7aae7320dbc0cb703417f38eb4d7aa7bd977e779 (patch) | |
| tree | fb056c1b1594f2333ad7d912a3ea690f9655f603 /src/rt/rust_builtin.cpp | |
| parent | 12d3d4f125c1209fe9f4337f0567a2dea6219ba6 (diff) | |
| download | rust-7aae7320dbc0cb703417f38eb4d7aa7bd977e779.tar.gz rust-7aae7320dbc0cb703417f38eb4d7aa7bd977e779.zip | |
std: change time::timeval to be {sec: i64, usec: i32}.
It's possible to have negative times if expressing time before 1970, so we should use signed types. Other platforms can return times at a higher resolution, so we should use 64 bits.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 0d1b67674a1..a5ef89bc201 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -408,7 +408,7 @@ rust_ptr_eq(type_desc *t, rust_box *a, rust_box *b) { #if defined(__WIN32__) extern "C" CDECL void -get_time(uint32_t *sec, uint32_t *usec) { +get_time(int64_t *sec, int32_t *usec) { FILETIME fileTime; GetSystemTimeAsFileTime(&fileTime); @@ -427,7 +427,7 @@ get_time(uint32_t *sec, uint32_t *usec) { } #else extern "C" CDECL void -get_time(uint32_t *sec, uint32_t *usec) { +get_time(int64_t *sec, int32_t *usec) { struct timeval tv; gettimeofday(&tv, NULL); *sec = tv.tv_sec; |
