OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_FUCHSIA) | 6 #if defined(TARGET_OS_FUCHSIA) |
7 | 7 |
8 #include "bin/platform.h" | 8 #include "bin/platform.h" |
9 | 9 |
10 #include <string.h> // NOLINT | 10 #include <string.h> // NOLINT |
(...skipping 28 matching lines...) Expand all Loading... |
39 const char* Platform::LibraryPrefix() { | 39 const char* Platform::LibraryPrefix() { |
40 return "lib"; | 40 return "lib"; |
41 } | 41 } |
42 | 42 |
43 | 43 |
44 const char* Platform::LibraryExtension() { | 44 const char* Platform::LibraryExtension() { |
45 return "so"; | 45 return "so"; |
46 } | 46 } |
47 | 47 |
48 | 48 |
49 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) { | 49 bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) { |
50 return gethostname(buffer, buffer_length) == 0; | 50 return gethostname(buffer, buffer_length) == 0; |
51 } | 51 } |
52 | 52 |
53 | 53 |
54 char** Platform::Environment(intptr_t* count) { | 54 char** Platform::Environment(intptr_t* count) { |
55 char** result = | 55 char** result = |
56 reinterpret_cast<char**>(Dart_ScopeAllocate(1 * sizeof(*result))); | 56 reinterpret_cast<char**>(Dart_ScopeAllocate(1 * sizeof(*result))); |
57 result[0] = NULL; | 57 result[0] = NULL; |
58 return result; | 58 return result; |
59 } | 59 } |
60 | 60 |
61 | 61 |
62 const char* Platform::ResolveExecutablePath() { | 62 const char* Platform::ResolveExecutablePath() { |
63 return "dart"; | 63 return "dart"; |
64 } | 64 } |
65 | 65 |
66 | 66 |
67 void Platform::Exit(int exit_code) { | 67 void Platform::Exit(int exit_code) { |
68 exit(exit_code); | 68 exit(exit_code); |
69 } | 69 } |
70 | 70 |
71 } // namespace bin | 71 } // namespace bin |
72 } // namespace dart | 72 } // namespace dart |
73 | 73 |
74 #endif // defined(TARGET_OS_FUCHSIA) | 74 #endif // defined(TARGET_OS_FUCHSIA) |
OLD | NEW |