summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--contrib/qemu/util/hbitmap.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 44e2d0875ad..04b6c72fd12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -664,7 +664,7 @@ dnl FreeBSD, NetBSD
AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec])
case $host_os in
*netbsd*)
- CFLAGS="${CFLAGS} -D_INCOMPLETE_XOPEN_C063"
+ CFLAGS="${CFLAGS} -D_INCOMPLETE_XOPEN_C063 -DCONFIG_MACHINE_BSWAP_H"
;;
esac
AC_CHECK_FUNC([linkat], [have_linkat=yes])
diff --git a/contrib/qemu/util/hbitmap.c b/contrib/qemu/util/hbitmap.c
index d93683128bd..e063e681f52 100644
--- a/contrib/qemu/util/hbitmap.c
+++ b/contrib/qemu/util/hbitmap.c
@@ -92,10 +92,12 @@ struct HBitmap {
unsigned long *levels[HBITMAP_LEVELS];
};
+#ifndef __NetBSD__ /* we have it in <strings.h> */
static inline int popcountl(unsigned long l)
{
return BITS_PER_LONG == 32 ? ctpop32(l) : ctpop64(l);
}
+#endif
/* Advance hbi to the next nonzero word and return it. hbi->pos
* is updated. Returns zero if we reach the end of the bitmap.