From 6ac68d00a5f3b4681ac3595dabcea47163b478d6 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 29 May 2015 19:39:41 +0000 Subject: [PATCH] Don't compile if there is a macro of the same name. --- common/lib/libc/string/popcount32.c | 8 ++++++-- common/lib/libc/string/popcount64.c | 9 ++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/common/lib/libc/string/popcount32.c b/common/lib/libc/string/popcount32.c index 6913fb8ade87..b23b4da1a38b 100644 --- a/common/lib/libc/string/popcount32.c +++ b/common/lib/libc/string/popcount32.c @@ -1,4 +1,4 @@ -/* $NetBSD: popcount32.c,v 1.4 2011/08/21 21:25:04 dholland Exp $ */ +/* $NetBSD: popcount32.c,v 1.5 2015/05/29 19:39:41 matt Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. @@ -32,7 +32,7 @@ */ #include -__RCSID("$NetBSD: popcount32.c,v 1.4 2011/08/21 21:25:04 dholland Exp $"); +__RCSID("$NetBSD: popcount32.c,v 1.5 2015/05/29 19:39:41 matt Exp $"); #if !defined(_KERNEL) && !defined(_STANDALONE) #include @@ -43,6 +43,8 @@ __RCSID("$NetBSD: popcount32.c,v 1.4 2011/08/21 21:25:04 dholland Exp $"); #include #endif +#ifndef popcount32 // might be a builtin + /* * This a hybrid algorithm for bit counting between parallel counting and * using multiplication. The idea is to sum up the bits in each Byte, so @@ -76,3 +78,5 @@ __strong_alias(popcount, popcount32) #if ULONG_MAX == 0xffffffffU __strong_alias(popcountl, popcount32) #endif + +#endif /* !popcount32 */ diff --git a/common/lib/libc/string/popcount64.c b/common/lib/libc/string/popcount64.c index 753fb9bd6e23..3a27c1d039d5 100644 --- a/common/lib/libc/string/popcount64.c +++ b/common/lib/libc/string/popcount64.c @@ -1,4 +1,4 @@ -/* $NetBSD: popcount64.c,v 1.7 2012/03/09 15:41:16 christos Exp $ */ +/* $NetBSD: popcount64.c,v 1.8 2015/05/29 19:39:41 matt Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. @@ -32,7 +32,7 @@ */ #include -__RCSID("$NetBSD: popcount64.c,v 1.7 2012/03/09 15:41:16 christos Exp $"); +__RCSID("$NetBSD: popcount64.c,v 1.8 2015/05/29 19:39:41 matt Exp $"); #if !defined(_KERNEL) && !defined(_STANDALONE) #include @@ -43,9 +43,11 @@ __RCSID("$NetBSD: popcount64.c,v 1.7 2012/03/09 15:41:16 christos Exp $"); #include #endif +#ifndef popcount64 // might be defined to use a __builtin + /* * If uint64_t is larger than size_t, the follow assumes that - * splitting into 32bit halfes is faster. + * splitting into 32bit halves is faster. * * The native pocount64 version is based on the same ideas as popcount32(3), * see popcount32.c for comments. @@ -83,3 +85,4 @@ __strong_alias(popcountl, popcount64) __strong_alias(popcountll, popcount64) #endif +#endif /* !popcount64 */