OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/os.h" | 5 #include "vm/os.h" |
6 | 6 |
7 #include <malloc.h> | 7 #include <malloc.h> |
8 #include <time.h> | 8 #include <time.h> |
9 | 9 |
| 10 #include "platform/utils.h" |
10 #include "platform/assert.h" | 11 #include "platform/assert.h" |
11 | 12 |
12 namespace dart { | 13 namespace dart { |
13 | 14 |
14 // As a side-effect sets the globals _timezone, _daylight and _tzname. | 15 // As a side-effect sets the globals _timezone, _daylight and _tzname. |
15 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { | 16 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { |
16 time_t seconds = static_cast<time_t>(seconds_since_epoch); | 17 time_t seconds = static_cast<time_t>(seconds_since_epoch); |
17 if (seconds != seconds_since_epoch) return false; | 18 if (seconds != seconds_since_epoch) return false; |
18 // localtime_s implicitly sets _timezone, _daylight and _tzname. | 19 // localtime_s implicitly sets _timezone, _daylight and _tzname. |
19 errno_t error_code = localtime_s(tm_result, &seconds); | 20 errno_t error_code = localtime_s(tm_result, &seconds); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 void OS::Abort() { | 260 void OS::Abort() { |
260 abort(); | 261 abort(); |
261 } | 262 } |
262 | 263 |
263 | 264 |
264 void OS::Exit(int code) { | 265 void OS::Exit(int code) { |
265 exit(code); | 266 exit(code); |
266 } | 267 } |
267 | 268 |
268 } // namespace dart | 269 } // namespace dart |
OLD | NEW |