mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
IN6_ARE_ADDR_EQUAL was used only once, replaced it.
This commit is contained in:
parent
550fced157
commit
99572e944a
|
@ -658,7 +658,7 @@ int ip_equal(IP *a, IP *b)
|
|||
if (a->family == AF_INET)
|
||||
return (a->ip4.in_addr.s_addr == b->ip4.in_addr.s_addr);
|
||||
else if (a->family == AF_INET6)
|
||||
return IN6_ARE_ADDR_EQUAL(&a->ip6.in6_addr, &b->ip6.in6_addr);
|
||||
return a->ip6.uint64[0] == b->ip6.uint64[0] && a->ip6.uint64[1] == b->ip6.uint64[1];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -52,18 +52,6 @@ typedef unsigned int sock_t;
|
|||
/* sa_family_t is the sockaddr_in / sockaddr_in6 family field */
|
||||
typedef short sa_family_t;
|
||||
|
||||
#ifndef IN6_ARE_ADDR_EQUAL
|
||||
#ifdef IN6_ADDR_EQUAL
|
||||
#define IN6_ARE_ADDR_EQUAL(a,b) IN6_ADDR_EQUAL(a,b)
|
||||
#else
|
||||
#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
|
||||
#endif
|
||||
|
||||
#ifndef EWOULDBLOCK
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user