| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 uint32_t path_size = 0; | 194 uint32_t path_size = 0; |
| 195 if (_NSGetExecutablePath(NULL, &path_size) == 0) { | 195 if (_NSGetExecutablePath(NULL, &path_size) == 0) { |
| 196 return NULL; | 196 return NULL; |
| 197 } | 197 } |
| 198 // Allocate buffer and get executable path. | 198 // Allocate buffer and get executable path. |
| 199 char* path = DartUtils::ScopedCString(path_size); | 199 char* path = DartUtils::ScopedCString(path_size); |
| 200 if (_NSGetExecutablePath(path, &path_size) != 0) { | 200 if (_NSGetExecutablePath(path, &path_size) != 0) { |
| 201 return NULL; | 201 return NULL; |
| 202 } | 202 } |
| 203 // Return the canonical path as the returned path might contain symlinks. | 203 // Return the canonical path as the returned path might contain symlinks. |
| 204 const char* canon_path = File::GetCanonicalPath(path); | 204 const char* canon_path = File::GetCanonicalPath(NULL, path); |
| 205 return canon_path; | 205 return canon_path; |
| 206 } | 206 } |
| 207 | 207 |
| 208 void Platform::Exit(int exit_code) { | 208 void Platform::Exit(int exit_code) { |
| 209 exit(exit_code); | 209 exit(exit_code); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace bin | 212 } // namespace bin |
| 213 } // namespace dart | 213 } // namespace dart |
| 214 | 214 |
| 215 #endif // defined(HOST_OS_MACOS) | 215 #endif // defined(HOST_OS_MACOS) |
| OLD | NEW |