Skip to content

Commit bd4e882

Browse files
tgcgitster
authored andcommitted
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 <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b500721 commit bd4e882

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ewah/ewok.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ static inline uint32_t ewah_bit_popcount64(uint64_t x)
4747
return (x * 0x0101010101010101ULL) >> 56;
4848
}
4949

50-
#ifdef __GNUC__
50+
/* __builtin_ctzll was not available until 3.4.0 */
51+
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR > 3))
5152
#define ewah_bit_ctz64(x) __builtin_ctzll(x)
5253
#else
5354
static inline int ewah_bit_ctz64(uint64_t x)

0 commit comments

Comments
 (0)