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(HOST_OS_MACOS) | 6 #if defined(HOST_OS_MACOS) |
7 | 7 |
8 #include "bin/platform.h" | 8 #include "bin/platform.h" |
9 | 9 |
10 #include <CoreFoundation/CoreFoundation.h> | 10 #include <CoreFoundation/CoreFoundation.h> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 if (!success) { | 141 if (!success) { |
142 return NULL; | 142 return NULL; |
143 } | 143 } |
144 return result; | 144 return result; |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 const char* Platform::LocaleName() { | 148 const char* Platform::LocaleName() { |
149 // First see if there is a preferred language. If not, return the | 149 // First see if there is a preferred language. If not, return the |
150 // current locale name. | 150 // current locale name. |
151 const char* preferred_langauge = GetPreferredLanguageName(); | 151 const char* preferred_language = GetPreferredLanguageName(); |
152 return (preferred_langauge != NULL) ? preferred_langauge : GetLocaleName(); | 152 return (preferred_language != NULL) ? preferred_language : GetLocaleName(); |
153 } | 153 } |
154 | 154 |
155 | 155 |
156 bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) { | 156 bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) { |
157 return gethostname(buffer, buffer_length) == 0; | 157 return gethostname(buffer, buffer_length) == 0; |
158 } | 158 } |
159 | 159 |
160 | 160 |
161 char** Platform::Environment(intptr_t* count) { | 161 char** Platform::Environment(intptr_t* count) { |
162 #if HOST_OS_IOS | 162 #if HOST_OS_IOS |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 | 216 |
217 void Platform::Exit(int exit_code) { | 217 void Platform::Exit(int exit_code) { |
218 exit(exit_code); | 218 exit(exit_code); |
219 } | 219 } |
220 | 220 |
221 } // namespace bin | 221 } // namespace bin |
222 } // namespace dart | 222 } // namespace dart |
223 | 223 |
224 #endif // defined(HOST_OS_MACOS) | 224 #endif // defined(HOST_OS_MACOS) |
OLD | NEW |