From fa3e60ad17caef1b95c6aafc7236cbf502b11685 Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen@gmail.com>
Date: Sat, 27 Jun 2015 21:13:13 +0000
Subject: [PATCH 2/3] Checks if it s NETBSD > 6.0 release

---
 include/common/standard.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/common/standard.h b/include/common/standard.h
index df2444d..4db7469 100644
--- a/include/common/standard.h
+++ b/include/common/standard.h
@@ -24,6 +24,7 @@
 
 #include <limits.h>
 #include <string.h>
+#include <strings.h>
 #include <time.h>
 #include <sys/time.h>
 #include <sys/types.h>
@@ -621,6 +622,14 @@ static inline unsigned int div64_32(unsigned long long o1, unsigned int o2)
 	return result;
 }
 
+#define HAPROXY_POPCOUNT_IMPL 1
+#ifdef __NetBSD__
+#if __NetBSD_Version__ >= 600000000
+#undef HAPROXY_POPCOUNT_IMPL
+#endif
+#endif
+
+#if defined(HAPROXY_POPCOUNT_IMPL)
 /* Simple popcount implementation. It returns the number of ones in a word */
 static inline unsigned int popcount(unsigned long a)
 {
@@ -631,6 +640,7 @@ static inline unsigned int popcount(unsigned long a)
 	}
 	return cnt;
 }
+#endif
 
 /* Build a word with the <bits> lower bits set (reverse of popcount) */
 static inline unsigned long nbits(int bits)
-- 
2.2.1

