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 "bin/platform.h" | 8 #include "bin/platform.h" |
9 | 9 |
10 #include <crt_externs.h> // NOLINT | 10 #include <crt_externs.h> // NOLINT |
(...skipping 25 matching lines...) Expand all Loading... |
36 int Platform::NumberOfProcessors() { | 36 int Platform::NumberOfProcessors() { |
37 return sysconf(_SC_NPROCESSORS_ONLN); | 37 return sysconf(_SC_NPROCESSORS_ONLN); |
38 } | 38 } |
39 | 39 |
40 | 40 |
41 const char* Platform::OperatingSystem() { | 41 const char* Platform::OperatingSystem() { |
42 return "macos"; | 42 return "macos"; |
43 } | 43 } |
44 | 44 |
45 | 45 |
| 46 const char* Platform::LibraryExtension() { |
| 47 return "dylib"; |
| 48 } |
| 49 |
| 50 |
46 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) { | 51 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) { |
47 return gethostname(buffer, buffer_length) == 0; | 52 return gethostname(buffer, buffer_length) == 0; |
48 } | 53 } |
49 | 54 |
50 | 55 |
51 char** Platform::Environment(intptr_t* count) { | 56 char** Platform::Environment(intptr_t* count) { |
52 // Using environ directly is only safe as long as we do not | 57 // Using environ directly is only safe as long as we do not |
53 // provide access to modifying environment variables. | 58 // provide access to modifying environment variables. |
54 // On MacOS you have to do a bit of magic to get to the | 59 // On MacOS you have to do a bit of magic to get to the |
55 // environment strings. | 60 // environment strings. |
(...skipping 11 matching lines...) Expand all Loading... |
67 | 72 |
68 | 73 |
69 void Platform::FreeEnvironment(char** env, intptr_t count) { | 74 void Platform::FreeEnvironment(char** env, intptr_t count) { |
70 delete[] env; | 75 delete[] env; |
71 } | 76 } |
72 | 77 |
73 } // namespace bin | 78 } // namespace bin |
74 } // namespace dart | 79 } // namespace dart |
75 | 80 |
76 #endif // defined(TARGET_OS_MACOS) | 81 #endif // defined(TARGET_OS_MACOS) |
OLD | NEW |