am 44443bea: Merge "Use _WIN32 rather than HAVE_WINSOCK."
* commit '44443bead6cf3c6e71029e7181f64ba82c6a8c8e': Use _WIN32 rather than HAVE_WINSOCK.
This commit is contained in:
commit
42dbc4b185
|
@ -234,7 +234,7 @@ static void fdevent_process()
|
|||
|
||||
#else /* USE_SELECT */
|
||||
|
||||
#ifdef HAVE_WINSOCK
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/select.h>
|
||||
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef HAVE_WINSOCK
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
typedef int socklen_t;
|
||||
#else
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_WINSOCK
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <netinet/in.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 <winsock2.h>
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <cutils/record_stream.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#ifdef HAVE_WINSOCK
|
||||
#if defined(_WIN32)
|
||||
#include <winsock2.h> /* for ntohl */
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef HAVE_WINSOCK
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/types.h>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <cutils/sockets.h>
|
||||
|
||||
#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 <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
@ -165,4 +165,4 @@ int socket_local_client(const char *name, int namespaceId, int type)
|
|||
return s;
|
||||
}
|
||||
|
||||
#endif /* !HAVE_WINSOCK */
|
||||
#endif /* !_WIN32 */
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#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 <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
@ -123,4 +123,4 @@ int socket_local_server(const char *name, int namespace, int type)
|
|||
return s;
|
||||
}
|
||||
|
||||
#endif /* !HAVE_WINSOCK */
|
||||
#endif /* !_WIN32 */
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef HAVE_WINSOCK
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/types.h>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#define LISTEN_BACKLOG 4
|
||||
|
||||
#ifndef HAVE_WINSOCK
|
||||
#if !defined(_WIN32)
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/types.h>
|
||||
|
|
|
@ -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 <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
@ -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) \
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef HAVE_WINSOCK
|
||||
#if defined(_WIN32)
|
||||
# undef nhtol
|
||||
# undef htonl
|
||||
# undef nhtos
|
||||
|
|
Loading…
Reference in New Issue