| 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 "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 7 | 7 |
| 8 #include <errno.h> // NOLINT | 8 #include <errno.h> // NOLINT |
| 9 #include <netdb.h> // NOLINT | 9 #include <netdb.h> // NOLINT |
| 10 #include <sys/time.h> // NOLINT | 10 #include <sys/time.h> // NOLINT |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 const int kBufferSize = 1024; | 33 const int kBufferSize = 1024; |
| 34 char error_buf[kBufferSize]; | 34 char error_buf[kBufferSize]; |
| 35 SetMessage(strerror_r(code, error_buf, kBufferSize)); | 35 SetMessage(strerror_r(code, error_buf, kBufferSize)); |
| 36 } else if (sub_system == kGetAddressInfo) { | 36 } else if (sub_system == kGetAddressInfo) { |
| 37 SetMessage(gai_strerror(code)); | 37 SetMessage(gai_strerror(code)); |
| 38 } else { | 38 } else { |
| 39 UNREACHABLE(); | 39 UNREACHABLE(); |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 | 42 |
| 43 const char* StringUtils::ConsoleStringToUtf8(const char* str) { | 43 const char* StringUtils::ConsoleStringToUtf8( |
| 44 return str; | 44 const char* str, intptr_t len, intptr_t* result_len) { |
| 45 } | |
| 46 | |
| 47 const char* StringUtils::Utf8ToConsoleString(const char* utf8) { | |
| 48 return utf8; | |
| 49 } | |
| 50 | |
| 51 char* StringUtils::ConsoleStringToUtf8(char* str) { | |
| 52 return str; | |
| 53 } | |
| 54 | |
| 55 char* StringUtils::Utf8ToConsoleString(char* utf8) { | |
| 56 return utf8; | |
| 57 } | |
| 58 | |
| 59 wchar_t* StringUtils::Utf8ToWide(char* utf8) { | |
| 60 UNIMPLEMENTED(); | 45 UNIMPLEMENTED(); |
| 61 return NULL; | 46 return NULL; |
| 62 } | 47 } |
| 63 | 48 |
| 64 const wchar_t* StringUtils::Utf8ToWide(const char* utf8) { | 49 const char* StringUtils::Utf8ToConsoleString( |
| 50 const char* utf8, intptr_t len, intptr_t* result_len) { |
| 65 UNIMPLEMENTED(); | 51 UNIMPLEMENTED(); |
| 66 return NULL; | 52 return NULL; |
| 67 } | 53 } |
| 68 | 54 |
| 69 char* StringUtils::WideToUtf8(wchar_t* str) { | 55 char* StringUtils::ConsoleStringToUtf8( |
| 56 char* str, intptr_t len, intptr_t* result_len) { |
| 70 UNIMPLEMENTED(); | 57 UNIMPLEMENTED(); |
| 71 return NULL; | 58 return NULL; |
| 72 } | 59 } |
| 73 | 60 |
| 74 const char* StringUtils::WideToUtf8(const wchar_t* str) { | 61 char* StringUtils::Utf8ToConsoleString( |
| 62 char* utf8, intptr_t len, intptr_t* result_len) { |
| 75 UNIMPLEMENTED(); | 63 UNIMPLEMENTED(); |
| 76 return NULL; | 64 return NULL; |
| 77 } | 65 } |
| 78 | 66 |
| 79 wchar_t** ShellUtils::GetUnicodeArgv(int* argc) { | 67 bool ShellUtils::GetUtf8Argv(int argc, char** argv) { |
| 80 return NULL; | 68 return false; |
| 81 } | |
| 82 | |
| 83 void ShellUtils::FreeUnicodeArgv(wchar_t** argv) { | |
| 84 } | 69 } |
| 85 | 70 |
| 86 int64_t TimerUtils::GetCurrentTimeMilliseconds() { | 71 int64_t TimerUtils::GetCurrentTimeMilliseconds() { |
| 87 return GetCurrentTimeMicros() / 1000; | 72 return GetCurrentTimeMicros() / 1000; |
| 88 } | 73 } |
| 89 | 74 |
| 90 int64_t TimerUtils::GetCurrentTimeMicros() { | 75 int64_t TimerUtils::GetCurrentTimeMicros() { |
| 91 struct timeval tv; | 76 struct timeval tv; |
| 92 if (gettimeofday(&tv, NULL) < 0) { | 77 if (gettimeofday(&tv, NULL) < 0) { |
| 93 UNREACHABLE(); | 78 UNREACHABLE(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 114 ASSERT(errno == EINTR); | 99 ASSERT(errno == EINTR); |
| 115 // Copy remainder into requested and repeat. | 100 // Copy remainder into requested and repeat. |
| 116 req = rem; | 101 req = rem; |
| 117 } | 102 } |
| 118 } | 103 } |
| 119 | 104 |
| 120 } // namespace bin | 105 } // namespace bin |
| 121 } // namespace dart | 106 } // namespace dart |
| 122 | 107 |
| 123 #endif // defined(TARGET_OS_LINUX) | 108 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |