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_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
7 | 7 |
8 #include "bin/platform.h" | 8 #include "bin/platform.h" |
9 #include "bin/log.h" | 9 #include "bin/log.h" |
10 #include "bin/socket.h" | 10 #include "bin/socket.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 GetSystemInfo(&info); | 25 GetSystemInfo(&info); |
26 return info.dwNumberOfProcessors; | 26 return info.dwNumberOfProcessors; |
27 } | 27 } |
28 | 28 |
29 | 29 |
30 const char* Platform::OperatingSystem() { | 30 const char* Platform::OperatingSystem() { |
31 return "windows"; | 31 return "windows"; |
32 } | 32 } |
33 | 33 |
34 | 34 |
| 35 const char* Platform::LibraryExtension() { |
| 36 return "dll"; |
| 37 } |
| 38 |
| 39 |
35 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) { | 40 bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) { |
36 if (!Socket::Initialize()) return false; | 41 if (!Socket::Initialize()) return false; |
37 return gethostname(buffer, buffer_length) == 0; | 42 return gethostname(buffer, buffer_length) == 0; |
38 } | 43 } |
39 | 44 |
40 | 45 |
41 char** Platform::Environment(intptr_t* count) { | 46 char** Platform::Environment(intptr_t* count) { |
42 wchar_t* strings = GetEnvironmentStringsW(); | 47 wchar_t* strings = GetEnvironmentStringsW(); |
43 if (strings == NULL) return NULL; | 48 if (strings == NULL) return NULL; |
44 wchar_t* tmp = strings; | 49 wchar_t* tmp = strings; |
(...skipping 23 matching lines...) Expand all Loading... |
68 for (intptr_t i = 0; i < count; i++) { | 73 for (intptr_t i = 0; i < count; i++) { |
69 free(env[i]); | 74 free(env[i]); |
70 } | 75 } |
71 delete[] env; | 76 delete[] env; |
72 } | 77 } |
73 | 78 |
74 } // namespace bin | 79 } // namespace bin |
75 } // namespace dart | 80 } // namespace dart |
76 | 81 |
77 #endif // defined(TARGET_OS_WINDOWS) | 82 #endif // defined(TARGET_OS_WINDOWS) |
OLD | NEW |