diff --git a/adb/fdevent.cpp b/adb/fdevent.cpp index 5cd498831851598b625689453b969234aec107c3..a8abade7850725c4200e6ca0f1b3c99080a7f71c 100644 --- a/adb/fdevent.cpp +++ b/adb/fdevent.cpp @@ -234,7 +234,7 @@ static void fdevent_process() #else /* USE_SELECT */ -#ifdef HAVE_WINSOCK +#if defined(_WIN32) #include #else #include @@ -617,7 +617,7 @@ void fdevent_install(fdevent *fde, int fd, fd_func func, void *arg) fde->func = func; fde->arg = arg; -#ifndef HAVE_WINSOCK +#if !defined(_WIN32) fcntl(fd, F_SETFL, O_NONBLOCK); #endif fdevent_register(fde); diff --git a/adb/services.cpp b/adb/services.cpp index 82efb1c043ad824d86a88dead2f3315a5d3574d4..708ef42f6e15525a11cf1a29979ddc68ab7b90c1 100644 --- a/adb/services.cpp +++ b/adb/services.cpp @@ -443,7 +443,7 @@ int service_to_fd(const char *name) return -1; #endif } -#ifndef HAVE_WINSOCK /* winsock doesn't implement unix domain sockets */ +#if !defined(_WIN32) /* winsock doesn't implement unix domain sockets */ } else if(!strncmp(name, "local:", 6)) { ret = socket_local_client(name + 6, ANDROID_SOCKET_NAMESPACE_RESERVED, SOCK_STREAM); diff --git a/include/cutils/sockets.h b/include/cutils/sockets.h index 07d1351a9e705101cbd3882ee60a8484a186a94d..2d3c743c00702ea555cca5bd453a5a062a794614 100644 --- a/include/cutils/sockets.h +++ b/include/cutils/sockets.h @@ -23,7 +23,7 @@ #include #include -#ifdef HAVE_WINSOCK +#if defined(_WIN32) #include typedef int socklen_t; #else diff --git a/include/utils/ByteOrder.h b/include/utils/ByteOrder.h index baa3a83dddfc474ff1c7bd15b21542ebc59f470d..44ea13df8e146baeb5879b73c3edac0b162b2936 100644 --- a/include/utils/ByteOrder.h +++ b/include/utils/ByteOrder.h @@ -21,7 +21,7 @@ #include #include -#ifdef HAVE_WINSOCK +#if defined(_WIN32) #include #else #include diff --git a/include/utils/FileMap.h b/include/utils/FileMap.h index f70fc927e4ca366af6b70541d2fa94fd6cec76c4..afd7bfd7bd71aff20cb649505db8ac73e3920e7a 100644 --- a/include/utils/FileMap.h +++ b/include/utils/FileMap.h @@ -26,7 +26,7 @@ #if defined(__MINGW32__) // Ensure that we always pull in winsock2.h before windows.h -#ifdef HAVE_WINSOCK +#if defined(_WIN32) #include #endif #include diff --git a/libcutils/record_stream.c b/libcutils/record_stream.c index 69949047c39741a0510dd23a577bb017fcef04d3..2bc4226edbc94b8332e1bd1aed0975e91228ff3d 100644 --- a/libcutils/record_stream.c +++ b/libcutils/record_stream.c @@ -22,7 +22,7 @@ #include #include #include -#ifdef HAVE_WINSOCK +#if defined(_WIN32) #include /* for ntohl */ #else #include diff --git a/libcutils/socket_inaddr_any_server.c b/libcutils/socket_inaddr_any_server.c index 6c849de771d62ca2e23ee1ebf51d2adf5c5d2a25..7f0ccb8e9cd87829005fe1007bea511fd1e6c1e0 100644 --- a/libcutils/socket_inaddr_any_server.c +++ b/libcutils/socket_inaddr_any_server.c @@ -20,7 +20,7 @@ #include #include -#ifndef HAVE_WINSOCK +#if !defined(_WIN32) #include #include #include diff --git a/libcutils/socket_local_client.c b/libcutils/socket_local_client.c index 7b42daaeec2bc5cca0eba6ea006553285c3aba8e..252614625fa6107cc6291e772c7c4e963141e9ef 100644 --- a/libcutils/socket_local_client.c +++ b/libcutils/socket_local_client.c @@ -22,7 +22,7 @@ #include -#ifdef HAVE_WINSOCK +#if defined(_WIN32) int socket_local_client(const char *name, int namespaceId, int type) { @@ -30,7 +30,7 @@ int socket_local_client(const char *name, int namespaceId, int type) return -1; } -#else /* !HAVE_WINSOCK */ +#else /* !_WIN32 */ #include #include @@ -165,4 +165,4 @@ int socket_local_client(const char *name, int namespaceId, int type) return s; } -#endif /* !HAVE_WINSOCK */ +#endif /* !_WIN32 */ diff --git a/libcutils/socket_local_server.c b/libcutils/socket_local_server.c index 60eb86b8320ed0025819d2d793ce9fcf933cde0f..c9acdad3ef64a61df5667c890596457f327788bf 100644 --- a/libcutils/socket_local_server.c +++ b/libcutils/socket_local_server.c @@ -23,7 +23,7 @@ #include #include -#ifdef HAVE_WINSOCK +#if defined(_WIN32) int socket_local_server(const char *name, int namespaceId, int type) { @@ -31,7 +31,7 @@ int socket_local_server(const char *name, int namespaceId, int type) return -1; } -#else /* !HAVE_WINSOCK */ +#else /* !_WIN32 */ #include #include @@ -123,4 +123,4 @@ int socket_local_server(const char *name, int namespace, int type) return s; } -#endif /* !HAVE_WINSOCK */ +#endif /* !_WIN32 */ diff --git a/libcutils/socket_loopback_client.c b/libcutils/socket_loopback_client.c index 9aed7b7ce4bd84fe1d7951fbdc7594bcabdc9963..e14cffbe97b4e8f8262b210372d88a161e095841 100644 --- a/libcutils/socket_loopback_client.c +++ b/libcutils/socket_loopback_client.c @@ -20,7 +20,7 @@ #include #include -#ifndef HAVE_WINSOCK +#if !defined(_WIN32) #include #include #include diff --git a/libcutils/socket_loopback_server.c b/libcutils/socket_loopback_server.c index 71afce70ffac5a7504820e7303c5cd767dc1c480..b600e347ee718417e169ab1a775f2c3b5e72919e 100644 --- a/libcutils/socket_loopback_server.c +++ b/libcutils/socket_loopback_server.c @@ -22,7 +22,7 @@ #define LISTEN_BACKLOG 4 -#ifndef HAVE_WINSOCK +#if !defined(_WIN32) #include #include #include diff --git a/liblog/log_read.c b/liblog/log_read.c index 9c4af30d0a08180736b8556218aad2fec5fea030..cfc8a7aca929086e56fd2342618affdcc751db3a 100644 --- a/liblog/log_read.c +++ b/liblog/log_read.c @@ -37,7 +37,7 @@ /* branchless on many architectures. */ #define min(x,y) ((y) ^ (((x) ^ (y)) & -((x) < (y)))) -#if (defined(USE_MINGW) || defined(HAVE_WINSOCK)) +#if defined(_WIN32) #define WEAK static #else #define WEAK __attribute__((weak)) @@ -48,7 +48,7 @@ /* Private copy of ../libcutils/socket_local_client.c prevent library loops */ -#ifdef HAVE_WINSOCK +#if defined(_WIN32) int WEAK socket_local_client(const char *name, int namespaceId, int type) { @@ -56,7 +56,7 @@ int WEAK socket_local_client(const char *name, int namespaceId, int type) return -ENOSYS; } -#else /* !HAVE_WINSOCK */ +#else /* !_WIN32 */ #include #include @@ -193,7 +193,7 @@ int WEAK socket_local_client(const char *name, int namespaceId, int type) return s; } -#endif /* !HAVE_WINSOCK */ +#endif /* !_WIN32 */ /* End of ../libcutils/socket_local_client.c */ #define logger_for_each(logger, logger_list) \ diff --git a/libutils/Unicode.cpp b/libutils/Unicode.cpp index fb876c91f0909d396497306ba953f15abb84af88..6f4b7217608d417d3391fb7701fef37c31ac99d4 100644 --- a/libutils/Unicode.cpp +++ b/libutils/Unicode.cpp @@ -18,7 +18,7 @@ #include -#ifdef HAVE_WINSOCK +#if defined(_WIN32) # undef nhtol # undef htonl # undef nhtos