summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2016-10-15 07:45:15 +0200
committerJens Georg <mail@jensge.org>2016-10-15 08:18:39 +0200
commitc982b4eee674f78bd27ee6a4158e98f625f5eba8 (patch)
treece5861e88bd755f0652eb377874d9408b189d071
parent87c0933e5b15f547832c363d108b10adc8b6ed08 (diff)
downloadgssdp-c982b4eee674f78bd27ee6a4158e98f625f5eba8.tar.gz
win32: Fix compiler issues with recent mingw
Signed-off-by: Jens Georg <mail@jensge.org>
-rw-r--r--libgssdp/gssdp-client.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index 7355441..655a713 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -226,18 +226,20 @@ gssdp_client_initable_init (GInitable *initable,
return TRUE;
#ifdef G_OS_WIN32
- WSADATA wsaData = {0};
- if (WSAStartup (MAKEWORD (2,2), &wsaData) != 0) {
- gchar *message;
-
- message = g_win32_error_message (WSAGetLastError ());
- g_set_error_literal (error,
- GSSDP_ERROR,
- GSSDP_ERROR_FAILED,
- message);
- g_free (message);
-
- return FALSE;
+ {
+ WSADATA wsaData = {0};
+ if (WSAStartup (MAKEWORD (2,2), &wsaData) != 0) {
+ gchar *message;
+
+ message = g_win32_error_message (WSAGetLastError ());
+ g_set_error_literal (error,
+ GSSDP_ERROR,
+ GSSDP_ERROR_FAILED,
+ message);
+ g_free (message);
+
+ return FALSE;
+ }
}
#endif
@@ -1567,7 +1569,6 @@ get_host_ip (GSSDPNetworkDevice *device)
char ip[INET6_ADDRSTRLEN];
char prefix[INET6_ADDRSTRLEN];
const char *p, *q;
- PIP_ADAPTER_ADDRESSES adapter;
PIP_ADAPTER_UNICAST_ADDRESS address;
PIP_ADAPTER_PREFIX address_prefix;
@@ -1595,11 +1596,12 @@ get_host_ip (GSSDPNetworkDevice *device)
}
if (p != NULL) {
+ gint32 mask = 0;
+
device->host_ip = g_strdup (p);
/* This relies on the compiler doing an arithmetic
* shift here!
*/
- gint32 mask = 0;
if (address_prefix->PrefixLength > 0) {
mask = (gint32) 0x80000000;
mask >>= address_prefix->PrefixLength - 1;