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) { |
| 41 #if defined(PLATFORM_DISABLE_SOCKET) |
| 42 return false; |
| 43 #else |
36 if (!Socket::Initialize()) return false; | 44 if (!Socket::Initialize()) return false; |
37 return gethostname(buffer, buffer_length) == 0; | 45 return gethostname(buffer, buffer_length) == 0; |
| 46 #endif |
38 } | 47 } |
39 | 48 |
40 | 49 |
41 char** Platform::Environment(intptr_t* count) { | 50 char** Platform::Environment(intptr_t* count) { |
42 wchar_t* strings = GetEnvironmentStringsW(); | 51 wchar_t* strings = GetEnvironmentStringsW(); |
43 if (strings == NULL) return NULL; | 52 if (strings == NULL) return NULL; |
44 wchar_t* tmp = strings; | 53 wchar_t* tmp = strings; |
45 intptr_t i = 0; | 54 intptr_t i = 0; |
46 while (*tmp != '\0') { | 55 while (*tmp != '\0') { |
47 // Skip environment strings starting with "=". | 56 // Skip environment strings starting with "=". |
(...skipping 20 matching lines...) Expand all Loading... |
68 for (intptr_t i = 0; i < count; i++) { | 77 for (intptr_t i = 0; i < count; i++) { |
69 free(env[i]); | 78 free(env[i]); |
70 } | 79 } |
71 delete[] env; | 80 delete[] env; |
72 } | 81 } |
73 | 82 |
74 } // namespace bin | 83 } // namespace bin |
75 } // namespace dart | 84 } // namespace dart |
76 | 85 |
77 #endif // defined(TARGET_OS_WINDOWS) | 86 #endif // defined(TARGET_OS_WINDOWS) |
OLD | NEW |