mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge pull request #593 from BtbN/win_fixes
Fix compilation on windows for ipv6 code
This commit is contained in:
commit
01ec9d6e7b
|
@ -28,6 +28,10 @@
|
|||
#include "network.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifndef IPV6_V6ONLY
|
||||
#define IPV6_V6ONLY 27
|
||||
#endif
|
||||
|
||||
/* return current UNIX time in microseconds (us). */
|
||||
uint64_t current_time(void)
|
||||
{
|
||||
|
@ -407,7 +411,7 @@ Networking_Core *new_networking(IP ip, uint16_t port)
|
|||
#ifdef LOGGING
|
||||
res =
|
||||
#endif
|
||||
setsockopt(temp->sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, sizeof(mreq));
|
||||
setsockopt(temp->sock, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, (char*)&mreq, sizeof(mreq));
|
||||
#ifdef LOGGING
|
||||
|
||||
if (res < 0) {
|
||||
|
|
|
@ -40,6 +40,15 @@
|
|||
#include <ws2tcpip.h>
|
||||
|
||||
typedef unsigned int sock_t;
|
||||
typedef unsigned int sa_family_t;
|
||||
|
||||
#ifndef IN6_ARE_ADDR_EQUAL
|
||||
#define IN6_ARE_ADDR_EQUAL(a,b) \
|
||||
((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \
|
||||
&& (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \
|
||||
&& (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \
|
||||
&& (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3]))
|
||||
#endif
|
||||
|
||||
#else // Linux includes
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user