Skip to content

Commit

Permalink
ewah: fix building with gcc < 3.4.0
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tom G. Christensen authored and Junio C Hamano committed Feb 4, 2015
1 parent b500721 commit bd4e882
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ewah/ewok.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bd4e882

Please sign in to comment.