Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: runtime/bin/utils_macos.cc

Issue 1194883002: Improve the encoding/decoding to/from system encoding on Windows (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Addressed review comments from lrn@ Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/bin/utils_linux.cc ('k') | runtime/bin/utils_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « runtime/bin/utils_linux.cc ('k') | runtime/bin/utils_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698