summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSiraj Razick <siraj.razick@collabora.co.uk>2012-01-02 13:12:08 -0500
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-01-03 10:59:25 +0000
commitb5bc31a5084e05d7e4251a37f628f7835928ab1c (patch)
tree19f8c58a77944bf429e8841bc4a31ec1d56a501f /lib
parent3cdfbe659bbe3a7e217486c2b0a957880b3c24ea (diff)
Make gabble cross compile with mingw32
The patch provides the changes required to make gabble compile under mingw32. - Index is replaced with strchr since index is deprecated and not included in mingw32 sdk - D_WIN32_WINNT=0x0501 is defined to make getnameinfo work - And other compile fixes
Diffstat (limited to 'lib')
-rw-r--r--lib/gibber/Makefile.am5
-rw-r--r--lib/gibber/gibber-listener.c2
-rw-r--r--lib/gibber/gibber-sockets-win32.h4
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/gibber/Makefile.am b/lib/gibber/Makefile.am
index f50bfd02e..0685be90a 100644
--- a/lib/gibber/Makefile.am
+++ b/lib/gibber/Makefile.am
@@ -63,6 +63,11 @@ gibber-signals-marshal.list: $(OUR_SOURCES) Makefile.am
AM_CFLAGS = $(ERROR_CFLAGS) $(GCOV_CFLAGS) @GLIB_CFLAGS@ @GMODULE_CFLAGS@ -fno-strict-aliasing
+# following flag is requied to make getnameinfo work
+if WINDOWS
+ AM_CFLAGS += -D_WIN32_WINNT=0x0501
+endif
+
AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@
Android.mk: Makefile.am $(BUILT_SOURCES)
diff --git a/lib/gibber/gibber-listener.c b/lib/gibber/gibber-listener.c
index 40d4610d7..a885294cb 100644
--- a/lib/gibber/gibber-listener.c
+++ b/lib/gibber/gibber-listener.c
@@ -259,7 +259,7 @@ add_listener (GibberListener *self, int family, int type, int protocol,
goto error;
}
- ret = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof (int));
+ ret = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (char *) &yes, sizeof (int));
if (ret == -1)
{
gibber_socket_set_error (error, "setsockopt failed",
diff --git a/lib/gibber/gibber-sockets-win32.h b/lib/gibber/gibber-sockets-win32.h
index d35e3cbdf..e61e28451 100644
--- a/lib/gibber/gibber-sockets-win32.h
+++ b/lib/gibber/gibber-sockets-win32.h
@@ -22,8 +22,8 @@
#include <winsock2.h>
#include <ws2tcpip.h>
-#include <Windows.h>
-#include <Winbase.h>
+#include <windows.h>
+#include <winbase.h>
/* Winsock makes some inappropriately-namespaced definitions */
#undef ERROR
#undef interface