diff options
author | YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp> | 2012-07-19 21:28:11 +0900 |
---|---|---|
committer | YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp> | 2013-05-17 17:21:28 +0900 |
commit | b2dd0849ce7f229ea5eb9fb88a112b7ad2c31642 (patch) | |
tree | ebe84a55e85389de6144c6ae7ea59444bfc7aa8a | |
parent | 0a20ad40de3395eb5e71b163e1bd4119ab099709 (diff) | |
download | redis-b2dd0849ce7f229ea5eb9fb88a112b7ad2c31642.tar.gz |
rename popcount to popcount_binary to avoid a conflict with NetBSD libc
NetBSD-current's libc has a function named popcount.
hiding these extensions using feature macros is not possible because
redis uses other extensions covered by the same feature macro.
eg. inet_aton
-rw-r--r-- | src/bitops.c | 4 | ||||
-rw-r--r-- | src/redis.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/bitops.c b/src/bitops.c index 47f768c31..1c2e13ddc 100644 --- a/src/bitops.c +++ b/src/bitops.c @@ -58,7 +58,7 @@ static int getBitOffsetFromArgument(redisClient *c, robj *o, size_t *offset) { /* Count number of bits set in the binary array pointed by 's' and long * 'count' bytes. The implementation of this function is required to * work with a input string length up to 512 MB. */ -size_t popcount(void *s, long count) { +size_t popcount_binary(void *s, long count) { size_t bits = 0; unsigned char *p; uint32_t *p4 = s; @@ -407,6 +407,6 @@ void bitcountCommand(redisClient *c) { } else { long bytes = end-start+1; - addReplyLongLong(c,popcount(p+start,bytes)); + addReplyLongLong(c,popcount_binary(p+start,bytes)); } } diff --git a/src/redis.h b/src/redis.h index 3002dd973..a39f3d81d 100644 --- a/src/redis.h +++ b/src/redis.h @@ -1010,7 +1010,7 @@ long long mstime(void); void getRandomHexChars(char *p, unsigned int len); uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l); void exitFromChild(int retcode); -size_t popcount(void *s, long count); +size_t popcount_binary(void *s, long count); void redisSetProcTitle(char *title); /* networking.c -- Networking and Client related operations */ |