aboutsummaryrefslogtreecommitdiff
path: root/ewah
diff options
context:
space:
mode:
authorTom G. Christensen <tgc@statsbiblioteket.dk>2015-02-04 09:23:16 +0100
committerJunio C Hamano <gitster@pobox.com>2015-02-04 10:45:31 -0800
commitbd4e8822da3bf6ce28a0c5f7c1bbf1b6341c0586 (patch)
tree79f4862187a7b453697eeb583b25be9d6d673f01 /ewah
parentb5007211b6582fc38647ff695b5ac51541ea9de8 (diff)
downloadgit-bd4e8822da3bf6ce28a0c5f7c1bbf1b6341c0586.tar.gz
git-bd4e8822da3bf6ce28a0c5f7c1bbf1b6341c0586.tar.xz
ewah: fix building with gcc < 3.4.0
The __builtin_ctzll function was added in gcc 3.4.0. This extends the check for gcc so that use of __builtin_ctzll is only enabled if gcc >= 3.4.0. Signed-off-by: Tom G. Christensen <tgc@statsbiblioteket.dk> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ewah')
-rw-r--r--ewah/ewok.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/ewah/ewok.h b/ewah/ewok.h
index 43adeb5c6..4b9584768 100644
--- a/ewah/ewok.h
+++ b/ewah/ewok.h
@@ -47,7 +47,8 @@ static inline uint32_t ewah_bit_popcount64(uint64_t x)
return (x * 0x0101010101010101ULL) >> 56;
}
-#ifdef __GNUC__
+/* __builtin_ctzll was not available until 3.4.0 */
+#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR > 3))
#define ewah_bit_ctz64(x) __builtin_ctzll(x)
#else
static inline int ewah_bit_ctz64(uint64_t x)