aboutsummaryrefslogtreecommitdiffstats
path: root/src/socket_util.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-05-18 23:12:56 +0200
committerMax Kellermann <max@duempel.org>2010-05-18 23:13:05 +0200
commit6aa0f61e15c1410e122096bc781a9443e4017385 (patch)
tree274dd99e2b467e3cf08e2e84fb9692d1b2deb05e /src/socket_util.c
parent4461c3d5d1bdc23ea361ebe0be0a117fa357236a (diff)
downloadmpd-6aa0f61e15c1410e122096bc781a9443e4017385.tar.gz
mpd-6aa0f61e15c1410e122096bc781a9443e4017385.tar.xz
mpd-6aa0f61e15c1410e122096bc781a9443e4017385.zip
socket_util: fix setsockopt() argument type on WIN32
In the winsock headers, the setsockopt() argument is declared as "const char *", not "const void *".
Diffstat (limited to 'src/socket_util.c')
-rw-r--r--src/socket_util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/socket_util.c b/src/socket_util.c
index 7895d3367..0909765ba 100644
--- a/src/socket_util.c
+++ b/src/socket_util.c
@@ -111,8 +111,14 @@ socket_bind_listen(int domain, int type, int protocol,
return -1;
}
+#ifdef WIN32
+ const char *optval = (const char *)&reuse;
+#else
+ const void *optval = &reuse;
+#endif
+
ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
- &reuse, sizeof(reuse));
+ optval, sizeof(reuse));
if (ret < 0) {
g_set_error(error, listen_quark(), errno,
"setsockopt() failed: %s", g_strerror(errno));