summaryrefslogtreecommitdiffstats
path: root/adb/adb_utils.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-07-24 11:35:40 -0700
committerElliott Hughes <enh@google.com>2015-07-24 11:35:40 -0700
commitd48dbd89c8661607b338b696c14c9609050f3f29 (patch)
tree6f687d9bb94aff8d0bed86499129100f9d59ab60 /adb/adb_utils.cpp
parentaddf7a964b5b17c00e5e371e2d0ed42eb5e563e1 (diff)
downloadcore-d48dbd89c8661607b338b696c14c9609050f3f29.tar.gz
core-d48dbd89c8661607b338b696c14c9609050f3f29.tar.bz2
core-d48dbd89c8661607b338b696c14c9609050f3f29.zip
Fix Win32 adb build.
Change-Id: I0a07379c470b7fa7f9bdef68c17ccb7bd0bd2079
Diffstat (limited to 'adb/adb_utils.cpp')
-rw-r--r--adb/adb_utils.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/adb/adb_utils.cpp b/adb/adb_utils.cpp
index 3846c2112..cd3c7bc6b 100644
--- a/adb/adb_utils.cpp
+++ b/adb/adb_utils.cpp
@@ -18,7 +18,6 @@
#include "adb_utils.h"
-#include <netdb.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -34,6 +33,12 @@
#include "adb_trace.h"
#include "sysdeps.h"
+#if defined(_WIN32)
+#include <ws2tcpip.h>
+#else
+#include <netdb.h>
+#endif
+
bool getcwd(std::string* s) {
char* cwd = getcwd(nullptr, 0);
if (cwd != nullptr) *s = cwd;
@@ -168,7 +173,7 @@ int network_connect(const std::string& host, int port, int type, int timeout, st
return fd;
}
if (getaddrinfo_error != 0) {
- // TODO: not thread safe on Win32.
+ // TODO: gai_strerror is not thread safe on Win32.
*error = gai_strerror(getaddrinfo_error);
} else {
*error = strerror(errno);