socket_util: fix setsockopt() argument type on WIN32

In the winsock headers, the setsockopt() argument is declared as
"const char *", not "const void *".
This commit is contained in:
Max Kellermann 2010-05-18 23:12:56 +02:00
parent 4461c3d5d1
commit 6aa0f61e15

View File

@ -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));