diff options
author | Ben Laurie <ben@openssl.org> | 2012-05-18 12:40:28 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2012-05-18 12:40:28 +0000 |
commit | 0de5a0feeef1e43aa080189c25af691448a2d860 (patch) | |
tree | fc240ede2841f5989ba737e02f6c7bd271b4678c /crypto/bio | |
parent | 4d321e0767bc928e47803dbc1a32bdbd01b17386 (diff) |
Work around macro issue with FreeBSD and gcc 4.6.
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bss_dgram.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 1b1e4bec81..46cbe8a407 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -81,6 +81,16 @@ #define IP_MTU 14 /* linux is lame */ #endif +#ifdef __FreeBSD__ +/* Standard definition causes type-punning problems. */ +#undef IN6_IS_ADDR_V4MAPPED +#define s6_addr32 __u6_addr.__u6_addr32 +#define IN6_IS_ADDR_V4MAPPED(a) \ + (((a)->s6_addr32[0] == 0) && \ + ((a)->s6_addr32[1] == 0) && \ + ((a)->s6_addr32[2] == htonl(0x0000ffff))) +#endif + #ifdef WATT32 #define sock_write SockWrite /* Watt-32 uses same names */ #define sock_read SockRead |