#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 {