summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarmawan Salihun <darmawan.salihun@gmail.com>2016-10-09 19:48:38 +0800
committerAlan Antonuk <alan.antonuk@gmail.com>2016-10-14 22:23:44 -0700
commit3d48ef56138700e2fa04b28b4c04267e27a78e83 (patch)
tree827c67b38094a9d104d515b2b1d1900553f652ff
parent4f50d2ec9d7b08ffb39d69731a58cad17e7d88b7 (diff)
downloadrabbitmq-c-3d48ef56138700e2fa04b28b4c04267e27a78e83.tar.gz
- Modified to enable cross-compilation with mingw-w64 cross compiler.
-rw-r--r--librabbitmq/amqp_private.h4
-rw-r--r--librabbitmq/amqp_socket.c4
-rw-r--r--librabbitmq/amqp_tcp_socket.c4
-rw-r--r--librabbitmq/amqp_time.c4
-rw-r--r--librabbitmq/amqp_time.h4
-rw-r--r--librabbitmq/win32/threads.h2
6 files changed, 11 insertions, 11 deletions
diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h
index 952480c..219b1be 100644
--- a/librabbitmq/amqp_private.h
+++ b/librabbitmq/amqp_private.h
@@ -48,7 +48,7 @@
#include "amqp_framing.h"
#include <string.h>
-#ifdef _WIN32
+#if ((defined(_WIN32)) || (defined(__MINGW32__)) || (defined(__MINGW64__)))
# 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 */
@@ -57,7 +57,7 @@
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
-# include <Winsock2.h>
+# include <winsock2.h>
#else
# include <arpa/inet.h>
# include <sys/uio.h>
diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c
index 13ed151..723dffa 100644
--- a/librabbitmq/amqp_socket.c
+++ b/librabbitmq/amqp_socket.c
@@ -57,11 +57,11 @@
#include <errno.h>
-#ifdef _WIN32
+#if ((defined(_WIN32)) || (defined(__MINGW32__)) || (defined(__MINGW64__)))
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
-# include <Winsock2.h>
+# include <winsock2.h>
# include <ws2tcpip.h>
#else
# include <sys/types.h> /* On older BSD this must come before net includes */
diff --git a/librabbitmq/amqp_tcp_socket.c b/librabbitmq/amqp_tcp_socket.c
index 004f3bb..a98190b 100644
--- a/librabbitmq/amqp_tcp_socket.c
+++ b/librabbitmq/amqp_tcp_socket.c
@@ -29,11 +29,11 @@
#include "amqp_tcp_socket.h"
#include <errno.h>
-#ifdef _WIN32
+#if ((defined(_WIN32)) || (defined(__MINGW32__)) || (defined(__MINGW64__)))
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
-# include <WinSock2.h>
+# include <winsock2.h>
#else
# include <sys/socket.h>
# include <netinet/in.h>
diff --git a/librabbitmq/amqp_time.c b/librabbitmq/amqp_time.c
index 44346fd..ea5cfc4 100644
--- a/librabbitmq/amqp_time.c
+++ b/librabbitmq/amqp_time.c
@@ -27,7 +27,7 @@
#include <limits.h>
#include <string.h>
-#if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32))
+#if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__) || defined(__MINGW64__))
# define AMQP_WIN_TIMER_API
#elif (defined(machintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
# define AMQP_MAC_TIMER_API
@@ -40,7 +40,7 @@
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
-#include <Windows.h>
+#include <windows.h>
uint64_t
amqp_get_monotonic_timestamp(void)
diff --git a/librabbitmq/amqp_time.h b/librabbitmq/amqp_time.h
index be939f1..034a224 100644
--- a/librabbitmq/amqp_time.h
+++ b/librabbitmq/amqp_time.h
@@ -26,14 +26,14 @@
#include <stdint.h>
-#ifdef _WIN32
+#if ((defined(_WIN32)) || (defined(__MINGW32__)) || (defined(__MINGW64__)))
# ifndef WINVER
# define WINVER 0x0502
# endif
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
-# include <Winsock2.h>
+# include <winsock2.h>
#else
# include <sys/time.h>
#endif
diff --git a/librabbitmq/win32/threads.h b/librabbitmq/win32/threads.h
index 9e261ec..1d1c53f 100644
--- a/librabbitmq/win32/threads.h
+++ b/librabbitmq/win32/threads.h
@@ -34,7 +34,7 @@
#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
-#include <Windows.h>
+#include <windows.h>
typedef CRITICAL_SECTION *pthread_mutex_t;
typedef int pthread_once_t;