summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiraj Razick <siraj.razick@collabora.co.uk>2012-01-26 21:20:04 (GMT)
committerSiraj Razick <siraj.razick@collabora.co.uk>2012-01-26 22:32:47 (GMT)
commit8a4afe112d4a61ffe9fa0fd629dd92fdc90e68b7 (patch)
tree8622b14ed939cedfb83367c9a94e115cf5b7dfd8
parent97a5823f03850f70bbd1da12af1364adc925e494 (diff)
Fix warnings from wocky-connector-test.c under mingw32
In windows socket API setsockopt takes a const char * as the fourth parameter, while on Linux it takes a void * so we cast to const char * which will work under both the platforms. This patch also move flags veriable in client_connected to the unix part of the ifdef, to remove warnings which shows up with mingw32.
-rw-r--r--tests/wocky-connector-test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/wocky-connector-test.c b/tests/wocky-connector-test.c
index 624a551..7476540 100644
--- a/tests/wocky-connector-test.c
+++ b/tests/wocky-connector-test.c
@@ -3140,10 +3140,11 @@ client_connected (GIOChannel *channel,
ConnectorProblem *cproblem = &test->server_parameters.problem.conn;
#ifdef G_OS_WIN32
u_long mode = 0;
+#else
+ long flags;
#endif
GSocketConnection *gconn;
- long flags;
if (csock < 0)
{
@@ -3199,7 +3200,7 @@ start_dummy_xmpp_server (test_t *test)
server.sin_addr.s_addr = inet_addr ((const char * ) REACHABLE);
server.sin_port = htons (port);
ssock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
- setsockopt (ssock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof (reuse));
+ setsockopt (ssock, SOL_SOCKET, SO_REUSEADDR, (const char *) &reuse, sizeof (reuse));
res = bind (ssock, (struct sockaddr *) &server, sizeof (server));