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:
parent
4461c3d5d1
commit
6aa0f61e15
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user