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_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <android/log.h> // NOLINT | 10 #include <android/log.h> // NOLINT |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } else { | 177 } else { |
178 DebugInfo::RegisterSection(name, base, size); | 178 DebugInfo::RegisterSection(name, base, size); |
179 } | 179 } |
180 } | 180 } |
181 | 181 |
182 private: | 182 private: |
183 DISALLOW_COPY_AND_ASSIGN(GdbCodeObserver); | 183 DISALLOW_COPY_AND_ASSIGN(GdbCodeObserver); |
184 }; | 184 }; |
185 | 185 |
186 | 186 |
| 187 const char* OS::Name() { |
| 188 return "android"; |
| 189 } |
| 190 |
| 191 |
187 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { | 192 static bool LocalTime(int64_t seconds_since_epoch, tm* tm_result) { |
188 time_t seconds = static_cast<time_t>(seconds_since_epoch); | 193 time_t seconds = static_cast<time_t>(seconds_since_epoch); |
189 if (seconds != seconds_since_epoch) return false; | 194 if (seconds != seconds_since_epoch) return false; |
190 struct tm* error_code = localtime_r(&seconds, tm_result); | 195 struct tm* error_code = localtime_r(&seconds, tm_result); |
191 return error_code != NULL; | 196 return error_code != NULL; |
192 } | 197 } |
193 | 198 |
194 | 199 |
195 const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) { | 200 const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) { |
196 tm decomposed; | 201 tm decomposed; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 } | 457 } |
453 | 458 |
454 | 459 |
455 void OS::Exit(int code) { | 460 void OS::Exit(int code) { |
456 exit(code); | 461 exit(code); |
457 } | 462 } |
458 | 463 |
459 } // namespace dart | 464 } // namespace dart |
460 | 465 |
461 #endif // defined(TARGET_OS_ANDROID) | 466 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |