summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2014-04-13 13:52:02 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2014-04-13 13:58:10 -0700
commitc2ce2cb0f356a48c409a27bc228dc3ad7218e82f (patch)
tree3f074a126ea341ec2bc1b175e485251b84ee7893
parent7001e824707ee549d129c21e07cc5d535883964f (diff)
downloadrabbitmq-c-github-ask-c2ce2cb0f356a48c409a27bc228dc3ad7218e82f.tar.gz
Mingw: specify WINVER 0x0502 when unspecified.
WINVER 0x0502 is WinXP SP2
-rw-r--r--librabbitmq/amqp_private.h8
-rw-r--r--librabbitmq/amqp_socket.h6
-rw-r--r--librabbitmq/amqp_timer.h4
-rw-r--r--librabbitmq/win32/threads.h6
4 files changed, 18 insertions, 6 deletions
diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h
index 1d74773..c2e63c3 100644
--- a/librabbitmq/amqp_private.h
+++ b/librabbitmq/amqp_private.h
@@ -46,6 +46,14 @@
#include <string.h>
#ifdef _WIN32
+# ifndef WINVER
+/* WINVER 0x0502 is WinXP SP2+, Windows Server 2003 SP1+
+ * See: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx#macros_for_conditional_declarations */
+# define WINVER 0x0502
+# endif
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
# include <Winsock2.h>
#else
# include <arpa/inet.h>
diff --git a/librabbitmq/amqp_socket.h b/librabbitmq/amqp_socket.h
index f8b6f51..bdeea63 100644
--- a/librabbitmq/amqp_socket.h
+++ b/librabbitmq/amqp_socket.h
@@ -28,11 +28,7 @@
#ifndef AMQP_SOCKET_H
#define AMQP_SOCKET_H
-#include "amqp.h"
-
-#ifdef _WIN32
-# include <WinSock2.h>
-#endif
+#include "amqp_private.h"
AMQP_BEGIN_DECLS
diff --git a/librabbitmq/amqp_timer.h b/librabbitmq/amqp_timer.h
index 946096d..8ac3de9 100644
--- a/librabbitmq/amqp_timer.h
+++ b/librabbitmq/amqp_timer.h
@@ -26,6 +26,9 @@
#include <stdint.h>
#ifdef _WIN32
+# ifndef WINVER
+# define WINVER 0x0502
+# endif
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
@@ -58,4 +61,3 @@ int
amqp_timer_update(amqp_timer_t *timer, struct timeval *timeout);
#endif /* AMQP_TIMER_H */
-
diff --git a/librabbitmq/win32/threads.h b/librabbitmq/win32/threads.h
index 668b2a3..d1de854 100644
--- a/librabbitmq/win32/threads.h
+++ b/librabbitmq/win32/threads.h
@@ -24,6 +24,12 @@
#ifndef AMQP_THREAD_H
#define AMQP_THREAD_H
+#ifndef WINVER
+# define WINVER 0x0502
+#endif
+#ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <Windows.h>
typedef CRITICAL_SECTION *pthread_mutex_t;