Commit 020e1260 authored by Orvid King's avatar Orvid King Committed by facebook-github-bot-4

Handle MSVC correctly in detail/IPAddress.h

Summary: Winsock's structures don't have a member named `s6_addr16`, so use the name for Winsock's structure.
Closes https://github.com/facebook/folly/pull/279

Reviewed By: @yfeldblum

Differential Revision: D2284223

Pulled By: @JoelMarcey
parent 0fe785ba
...@@ -283,7 +283,11 @@ inline std::string fastIpv4ToString( ...@@ -283,7 +283,11 @@ inline std::string fastIpv4ToString(
} }
inline std::string fastIpv6ToString(const in6_addr& in6Addr) { inline std::string fastIpv6ToString(const in6_addr& in6Addr) {
#ifdef _MSC_VER
const uint16_t* bytes = reinterpret_cast<const uint16_t*>(&in6Addr.u.Word);
#else
const uint16_t* bytes = reinterpret_cast<const uint16_t*>(&in6Addr.s6_addr16); const uint16_t* bytes = reinterpret_cast<const uint16_t*>(&in6Addr.s6_addr16);
#endif
char str[sizeof("2001:0db8:0000:0000:0000:ff00:0042:8329")]; char str[sizeof("2001:0db8:0000:0000:0000:ff00:0042:8329")];
char* buf = str; char* buf = str;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment