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

Unified Diff: runtime/bin/platform_win.cc

Issue 10050011: Add member localHostname() to the Dart IO Platform class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/platform_win.cc
diff --git a/runtime/bin/platform_win.cc b/runtime/bin/platform_win.cc
index e1f9ced1f427cbc1c7f782303cebaf8d1bc3eede..22cc2dc28748fd2c3796350149801cf54656feca 100644
--- a/runtime/bin/platform_win.cc
+++ b/runtime/bin/platform_win.cc
@@ -3,11 +3,12 @@
// BSD-style license that can be found in the LICENSE file.
#include "bin/platform.h"
+#include "bin/socket.h"
bool Platform::Initialize() {
- // Nothing to do on Windows.
- return true;
+ // Load Socket for LocalHostname.
Søren Gjesse 2012/04/11 11:00:54 I think we should consider moving this to LocalHos
+ return Socket::Initialize();
Anders Johnsen 2012/04/11 10:12:12 I would like to move the Socket::Initialize setup
}
@@ -23,6 +24,11 @@ const char* Platform::OperatingSystem() {
}
+bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
+ return gethostname(buffer, buffer_length) == 0;
+}
+
+
char* Platform::StrError(int error_code) {
static const int kBufferSize = 1024;
char* error = static_cast<char*>(malloc(kBufferSize));

Powered by Google App Engine
This is Rietveld 408576698