diff options
author | 2016-05-03 12:56:40 -0700 | |
---|---|---|
committer | 2016-05-03 12:56:40 -0700 | |
commit | 7c6ba9bae47bdeb6f532b457d9848e7dc94c8e14 (patch) | |
tree | dd56d6b41d03feedf1f51420507b958af7473c1a /src/core/lib/iomgr/tcp_windows.c | |
parent | 27f59afecb04b63b7c83a842d400efb1ad09049a (diff) | |
parent | 6bac7d3467c99dccc30e8447bc84237bb54b99fe (diff) |
Merge github.com:grpc/grpc into error
Diffstat (limited to 'src/core/lib/iomgr/tcp_windows.c')
-rw-r--r-- | src/core/lib/iomgr/tcp_windows.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/core/lib/iomgr/tcp_windows.c b/src/core/lib/iomgr/tcp_windows.c index 7ee689a7e4..551149e1a6 100644 --- a/src/core/lib/iomgr/tcp_windows.c +++ b/src/core/lib/iomgr/tcp_windows.c @@ -35,6 +35,8 @@ #ifdef GPR_WINSOCK_SOCKET +#include <limits.h> + #include "src/core/lib/iomgr/sockaddr_win32.h" #include <grpc/support/alloc.h> @@ -51,12 +53,20 @@ #include "src/core/lib/iomgr/tcp_client.h" #include "src/core/lib/iomgr/timer.h" +#if defined(__MSYS__) && defined(GPR_ARCH_64) +/* Nasty workaround for nasty bug when using the 64 bits msys compiler + in conjunction with Microsoft Windows headers. */ +#define GRPC_FIONBIO _IOW('f', 126, uint32_t) +#else +#define GRPC_FIONBIO FIONBIO +#endif + static int set_non_block(SOCKET sock) { int status; - unsigned long param = 1; + uint32_t param = 1; DWORD ret; - status = - WSAIoctl(sock, FIONBIO, ¶m, sizeof(param), NULL, 0, &ret, NULL, NULL); + status = WSAIoctl(sock, GRPC_FIONBIO, ¶m, sizeof(param), NULL, 0, &ret, + NULL, NULL); return status == 0; } |