mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
cleanup: Some portability/warning fixes for Windows builds.
This commit is contained in:
parent
425216d9ec
commit
415cb78f5e
|
@ -1 +1 @@
|
|||
7923791feaca748f570f81dd79556c7763fa2f7611e3790129fe44ffa95cf916 /usr/local/bin/tox-bootstrapd
|
||||
269d2d95028f192bbf65a01b938068b8fc9e798bbe1d5ecaf67cae124e45c2a9 /usr/local/bin/tox-bootstrapd
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#define _XOPEN_SOURCE 700
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_WINXP
|
||||
#if defined(_WIN32) && defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WINXP
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x501
|
||||
#endif
|
||||
|
@ -361,13 +361,9 @@ IP4 get_ip4_loopback(void)
|
|||
|
||||
IP6 get_ip6_loopback(void)
|
||||
{
|
||||
IP6 loopback;
|
||||
#ifdef ESP_PLATFORM
|
||||
loopback = empty_ip_port.ip.ip.v6;
|
||||
/* in6addr_loopback isn't available everywhere, so we do it ourselves. */
|
||||
IP6 loopback = empty_ip_port.ip.ip.v6;
|
||||
loopback.uint8[15] = 1;
|
||||
#else
|
||||
get_ip6(&loopback, &in6addr_loopback);
|
||||
#endif
|
||||
return loopback;
|
||||
}
|
||||
|
||||
|
@ -565,7 +561,7 @@ non_null()
|
|||
static int sys_getsockopt(void *obj, int sock, int level, int optname, void *optval, size_t *optlen)
|
||||
{
|
||||
socklen_t len = *optlen;
|
||||
const int ret = getsockopt(sock, level, optname, optval, &len);
|
||||
const int ret = getsockopt(sock, level, optname, (char *)optval, &len);
|
||||
*optlen = len;
|
||||
return ret;
|
||||
}
|
||||
|
@ -573,7 +569,7 @@ static int sys_getsockopt(void *obj, int sock, int level, int optname, void *opt
|
|||
non_null()
|
||||
static int sys_setsockopt(void *obj, int sock, int level, int optname, const void *optval, size_t optlen)
|
||||
{
|
||||
return setsockopt(sock, level, optname, optval, optlen);
|
||||
return setsockopt(sock, level, optname, (const char *)optval, optlen);
|
||||
}
|
||||
|
||||
static const Network_Funcs system_network_funcs = {
|
||||
|
|
Loading…
Reference in New Issue
Block a user