Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: runtime/bin/platform_win.cc

Issue 885433002: Fix Windows build (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/bin.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 return "windows"; 31 return "windows";
32 } 32 }
33 33
34 34
35 const char* Platform::LibraryExtension() { 35 const char* Platform::LibraryExtension() {
36 return "dll"; 36 return "dll";
37 } 37 }
38 38
39 39
40 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
41 if (!Socket::Initialize()) return false; 44 if (!Socket::Initialize()) return false;
42 return gethostname(buffer, buffer_length) == 0; 45 return gethostname(buffer, buffer_length) == 0;
46 #endif
43 } 47 }
44 48
45 49
46 char** Platform::Environment(intptr_t* count) { 50 char** Platform::Environment(intptr_t* count) {
47 wchar_t* strings = GetEnvironmentStringsW(); 51 wchar_t* strings = GetEnvironmentStringsW();
48 if (strings == NULL) return NULL; 52 if (strings == NULL) return NULL;
49 wchar_t* tmp = strings; 53 wchar_t* tmp = strings;
50 intptr_t i = 0; 54 intptr_t i = 0;
51 while (*tmp != '\0') { 55 while (*tmp != '\0') {
52 // Skip environment strings starting with "=". 56 // Skip environment strings starting with "=".
(...skipping 20 matching lines...) Expand all
73 for (intptr_t i = 0; i < count; i++) { 77 for (intptr_t i = 0; i < count; i++) {
74 free(env[i]); 78 free(env[i]);
75 } 79 }
76 delete[] env; 80 delete[] env;
77 } 81 }
78 82
79 } // namespace bin 83 } // namespace bin
80 } // namespace dart 84 } // namespace dart
81 85
82 #endif // defined(TARGET_OS_WINDOWS) 86 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/bin.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698