From 58eda35acecda91ccbc90023de4f0c4a46beafd6 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Tue, 15 Nov 2016 12:58:44 -0800 Subject: [PATCH] adb: actually fix the windows build. Bug: http://b/32292581 Change-Id: I714e1f47c2c2e89027989d485cb28891b905f931 --- adb/sockets.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/adb/sockets.c b/adb/sockets.c index da894c3f0..d4866817f 100644 --- a/adb/sockets.c +++ b/adb/sockets.c @@ -20,13 +20,17 @@ #include #include #include -#include #include "sysdeps.h" #define TRACE_TAG TRACE_SOCKETS #include "adb.h" +#if defined(_WIN32) +#define pthread_mutex_lock(...) abort() +#define pthread_mutex_unlock(...) abort() +#else +#include static pthread_mutex_t socket_list_lock; static void __attribute__((constructor)) socket_list_lock_init(void) { pthread_mutexattr_t attr; @@ -34,6 +38,7 @@ static void __attribute__((constructor)) socket_list_lock_init(void) { pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&socket_list_lock, &attr); } +#endif int sendfailmsg(int fd, const char *reason) {