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/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 #include "vm/vtune.h" | 9 #include "vm/vtune.h" |
10 | 10 |
11 #include <malloc.h> // NOLINT | 11 #include <malloc.h> // NOLINT |
12 #include <time.h> // NOLINT | 12 #include <time.h> // NOLINT |
13 | 13 |
14 #include "platform/utils.h" | 14 #include "platform/utils.h" |
15 #include "platform/assert.h" | 15 #include "platform/assert.h" |
16 | 16 |
17 namespace dart { | 17 namespace dart { |
18 | 18 |
| 19 const char* OS::Name() { |
| 20 return "windows"; |
| 21 } |
| 22 |
| 23 |
19 // As a side-effect sets the globals _timezone, _daylight and _tzname. | 24 // As a side-effect sets the globals _timezone, _daylight and _tzname. |
20 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { | 25 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { |
21 time_t seconds = static_cast<time_t>(seconds_since_epoch); | 26 time_t seconds = static_cast<time_t>(seconds_since_epoch); |
22 if (seconds != seconds_since_epoch) return false; | 27 if (seconds != seconds_since_epoch) return false; |
23 // localtime_s implicitly sets _timezone, _daylight and _tzname. | 28 // localtime_s implicitly sets _timezone, _daylight and _tzname. |
24 errno_t error_code = localtime_s(tm_result, &seconds); | 29 errno_t error_code = localtime_s(tm_result, &seconds); |
25 return error_code == 0; | 30 return error_code == 0; |
26 } | 31 } |
27 | 32 |
28 | 33 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } | 311 } |
307 | 312 |
308 | 313 |
309 void OS::Exit(int code) { | 314 void OS::Exit(int code) { |
310 exit(code); | 315 exit(code); |
311 } | 316 } |
312 | 317 |
313 } // namespace dart | 318 } // namespace dart |
314 | 319 |
315 #endif // defined(TARGET_OS_WINDOWS) | 320 #endif // defined(TARGET_OS_WINDOWS) |
OLD | NEW |