$NetBSD: patch-configure.ac,v 1.1 2022/04/12 22:22:26 nikita Exp $ Upstream commit 1acaf9980b55ae180cc08db218b9face28202519 from Alyssa Ross. Use popcount64 from libc when available Without this, we get a compiler error on NetBSD because the one in libc has a slightly different prototype. libcpuid_util.c:78:12: error: conflicting types for 'popcount64' 78 | static int popcount64(uint64_t mask) | ^~~~~~~~~~ In file included from /nix/store/155rj8nqh3xd80vpa8hl35p3hk7pacys-include-netbsd-8.0/include/string.h:98, from libcpuid_util.c:30: /nix/store/155rj8nqh3xd80vpa8hl35p3hk7pacys-include-netbsd-8.0/include/strings.h:61:14: note: previous declaration of 'popcount64' was here 61 | unsigned int popcount64(__uint64_t) __constfunc; | ^~~~~~~~~~ * Return unsigned int from popcount64 Matches NetBSD libc, where popcount64 originates. --- configure.ac.orig +++ configure.ac @@ -43,6 +43,8 @@ LT_INIT AM_CPPFLAGS="$CPPFLAGS" AC_CHECK_HEADERS([stdint.h]) +AC_CHECK_FUNCS([popcount64]) + AC_CHECK_PROGS([DOXYGEN], [doxygen]) AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])