Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/common/lib/libc/string Don't compile if there is a macro of ...
details: https://anonhg.NetBSD.org/src/rev/979f9996de45
branches: trunk
changeset: 338549:979f9996de45
user: matt <matt%NetBSD.org@localhost>
date: Fri May 29 19:39:41 2015 +0000
description:
Don't compile if there is a macro of the same name.
diffstat:
common/lib/libc/string/popcount32.c | 8 ++++++--
common/lib/libc/string/popcount64.c | 9 ++++++---
2 files changed, 12 insertions(+), 5 deletions(-)
diffs (69 lines):
diff -r f3941742ef14 -r 979f9996de45 common/lib/libc/string/popcount32.c
--- a/common/lib/libc/string/popcount32.c Fri May 29 19:38:59 2015 +0000
+++ b/common/lib/libc/string/popcount32.c Fri May 29 19:39:41 2015 +0000
@@ -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 <sys/cdefs.h>
-__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 <limits.h>
@@ -43,6 +43,8 @@
#include <machine/limits.h>
#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 @@
#if ULONG_MAX == 0xffffffffU
__strong_alias(popcountl, popcount32)
#endif
+
+#endif /* !popcount32 */
diff -r f3941742ef14 -r 979f9996de45 common/lib/libc/string/popcount64.c
--- a/common/lib/libc/string/popcount64.c Fri May 29 19:38:59 2015 +0000
+++ b/common/lib/libc/string/popcount64.c Fri May 29 19:39:41 2015 +0000
@@ -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 <sys/cdefs.h>
-__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 <limits.h>
@@ -43,9 +43,11 @@
#include <machine/limits.h>
#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(popcountll, popcount64)
#endif
+#endif /* !popcount64 */
Home |
Main Index |
Thread Index |
Old Index