summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2015-05-04 22:00:10 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2015-05-04 23:40:34 -0700
commit3546a7072cfc2a5b13194fe13378c4817d40dcb4 (patch)
treebd4ff16724953015c5c53b4fce6c2975d177a5e8
parent61e458e8abfd562220df8f517fd159967d9f568c (diff)
downloadrabbitmq-c-3546a7072cfc2a5b13194fe13378c4817d40dcb4.tar.gz
Don't redefine EINPROGRESS EWOULDBLOCK on Win32.
These constants are already defined in the Win32, and they're being incorrectly redefined by rabbitmq-c.
-rw-r--r--librabbitmq/amqp_socket.c5
-rw-r--r--librabbitmq/amqp_tcp_socket.c4
2 files changed, 4 insertions, 5 deletions
diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c
index f4ecaeb..545f2cd 100644
--- a/librabbitmq/amqp_socket.c
+++ b/librabbitmq/amqp_socket.c
@@ -75,7 +75,6 @@
#ifdef _WIN32
# define poll(fdarray, nfds, timeout) WSAPoll(fdarray, nfds, timeout)
-# define EINPROGRESS WSAEWOULDBLOCK
#endif
static int
@@ -434,7 +433,11 @@ int amqp_open_socket_inner(char const *hostname,
break;
}
+#ifdef _WIN32
+ if (WSAEWOULDBLOCK == amqp_os_socket_error()) {
+#else
if (EINPROGRESS == amqp_os_socket_error()) {
+#endif
last_error = amqp_poll_write(sockfd, deadline);
if (AMQP_STATUS_OK == last_error) {
int result;
diff --git a/librabbitmq/amqp_tcp_socket.c b/librabbitmq/amqp_tcp_socket.c
index b70ccf0..e14cf38 100644
--- a/librabbitmq/amqp_tcp_socket.c
+++ b/librabbitmq/amqp_tcp_socket.c
@@ -32,10 +32,6 @@
#include <stdio.h>
#include <stdlib.h>
-#ifdef _WIN32
-# define EWOULDBLOCK WSAEWOULDBLOCK
-#endif
-
struct amqp_tcp_socket_t {
const struct amqp_socket_class_t *klass;
int sockfd;