OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/builtin.h" | 8 #include "bin/builtin.h" |
9 #include "bin/eventhandler.h" | 9 #include "bin/eventhandler.h" |
10 #include "bin/file.h" | 10 #include "bin/file.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 Handle* handle = reinterpret_cast<Handle*>(fd); | 174 Handle* handle = reinterpret_cast<Handle*>(fd); |
175 switch (GetFileType(handle->handle())) { | 175 switch (GetFileType(handle->handle())) { |
176 case FILE_TYPE_CHAR: return File::kTerminal; | 176 case FILE_TYPE_CHAR: return File::kTerminal; |
177 case FILE_TYPE_PIPE: return File::kPipe; | 177 case FILE_TYPE_PIPE: return File::kPipe; |
178 case FILE_TYPE_DISK: return File::kFile; | 178 case FILE_TYPE_DISK: return File::kFile; |
179 default: return GetLastError == NO_ERROR ? File::kOther : -1; | 179 default: return GetLastError == NO_ERROR ? File::kOther : -1; |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 | 183 |
184 intptr_t Socket::GetStdioHandle(int num) { | 184 intptr_t Socket::GetStdioHandle(intptr_t num) { |
185 HANDLE handle; | 185 HANDLE handle; |
186 switch (num) { | 186 switch (num) { |
187 case 0: | 187 case 0: |
188 handle = GetStdHandle(STD_INPUT_HANDLE); | 188 handle = GetStdHandle(STD_INPUT_HANDLE); |
189 break; | 189 break; |
190 case 1: | 190 case 1: |
191 handle = GetStdHandle(STD_OUTPUT_HANDLE); | 191 handle = GetStdHandle(STD_OUTPUT_HANDLE); |
192 break; | 192 break; |
193 case 2: | 193 case 2: |
194 handle = GetStdHandle(STD_ERROR_HANDLE); | 194 handle = GetStdHandle(STD_ERROR_HANDLE); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 IPPROTO_TCP, | 438 IPPROTO_TCP, |
439 TCP_NODELAY, | 439 TCP_NODELAY, |
440 reinterpret_cast<char *>(&on), | 440 reinterpret_cast<char *>(&on), |
441 sizeof(on)) == 0; | 441 sizeof(on)) == 0; |
442 } | 442 } |
443 | 443 |
444 } // namespace bin | 444 } // namespace bin |
445 } // namespace dart | 445 } // namespace dart |
446 | 446 |
447 #endif // defined(TARGET_OS_WINDOWS) | 447 #endif // defined(TARGET_OS_WINDOWS) |
OLD | NEW |