Provide backfill s6_addr16 on BSD platforms
[folly.git] / folly / detail / IPAddress.h
index 5d7df8cde651db4c4bb06739b3f8be25fe219beb..0ebd76f7459280b7a624e9c039e9b48026f34213 100644 (file)
@@ -46,8 +46,12 @@ extern "C" {
 #include <folly/Conv.h>
 #include <folly/Format.h>
 
-#if defined(__APPLE__) && !defined(s6_addr16)
-# define s6_addr16 __u6_addr.__u6_addr16
+// BSDish platforms don't provide standard access to s6_addr16
+#ifndef s6_addr16
+# if defined(__APPLE__) || defined(__FreeBSD__) || \
+     defined(__NetBSD__) || defined(__OpenBSD__)
+#  define s6_addr16 __u6_addr.__u6_addr16
+# endif
 #endif
 
 namespace folly { namespace detail {