Skip to content

Commit

Permalink
Moved IN6_ADDR_EQUAL to ws2ipdef.h and added IN6_ARE_ADDR_EQUAL define.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/mingw-w64/code@6506 4407c894-4637-0410-b4f5-ada5f102cad1
  • Loading branch information
cjacek committed Feb 26, 2014
1 parent 6e5740d commit 0f48994
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 9 additions & 0 deletions trunk/mingw-w64-headers/include/ws2ipdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ typedef struct group_source_req {
#define IPV6_TCLASS 39
#define IPV6_RECVTCLASS 40

#define WS2TCPIP_INLINE __CRT_INLINE

int IN6_ADDR_EQUAL(const struct in6_addr *,const struct in6_addr *);
WS2TCPIP_INLINE int IN6_ADDR_EQUAL(const struct in6_addr *a, const struct in6_addr *b) {
return !memcmp(a, b, sizeof(struct in6_addr));
}

#define IN6_ARE_ADDR_EQUAL IN6_ADDR_EQUAL

#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 1 addition & 4 deletions trunk/mingw-w64-headers/include/ws2tcpip.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <_mingw_unicode.h>

#include <winsock2.h>
#include <ws2ipdef.h>
#include <psdk_inc/_ip_mreq1.h>
#include <winapifamily.h>

Expand Down Expand Up @@ -78,9 +79,6 @@ extern "C" {
extern const struct in6_addr in6addr_any;
extern const struct in6_addr in6addr_loopback;

#define WS2TCPIP_INLINE __CRT_INLINE

int IN6_ADDR_EQUAL(const struct in6_addr *,const struct in6_addr *);
int IN6_IS_ADDR_UNSPECIFIED(const struct in6_addr *);
int IN6_IS_ADDR_LOOPBACK(const struct in6_addr *);
int IN6_IS_ADDR_MULTICAST(const struct in6_addr *);
Expand All @@ -100,7 +98,6 @@ void IN6_SET_ADDR_LOOPBACK(struct in6_addr *);
void IN6ADDR_SETANY(struct sockaddr_in6 *);
void IN6ADDR_SETLOOPBACK(struct sockaddr_in6 *);

WS2TCPIP_INLINE int IN6_ADDR_EQUAL(const struct in6_addr *a,const struct in6_addr *b) { return (memcmp(a,b,sizeof(struct in6_addr))==0); }
WS2TCPIP_INLINE int IN6_IS_ADDR_UNSPECIFIED(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && (a->s6_words[6]==0) && (a->s6_words[7]==0)); }
WS2TCPIP_INLINE int IN6_IS_ADDR_LOOPBACK(const struct in6_addr *a) { return ((a->s6_words[0]==0) && (a->s6_words[1]==0) && (a->s6_words[2]==0) && (a->s6_words[3]==0) && (a->s6_words[4]==0) && (a->s6_words[5]==0) && (a->s6_words[6]==0) && (a->s6_words[7]==0x0100)); }
WS2TCPIP_INLINE int IN6_IS_ADDR_MULTICAST(const struct in6_addr *a) { return (a->s6_bytes[0]==0xff); }
Expand Down

0 comments on commit 0f48994

Please sign in to comment.