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