From 6091efb4d64ed745495455ba82352ec82f55cb4f Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 30 Mar 2025 02:08:06 +0200 Subject: [PATCH] lightrec: fixup for old compilers --- deps/lightrec/lightrec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deps/lightrec/lightrec.c b/deps/lightrec/lightrec.c index c8e91b71..488ceb28 100644 --- a/deps/lightrec/lightrec.c +++ b/deps/lightrec/lightrec.c @@ -567,12 +567,13 @@ static void lightrec_mtc0(struct lightrec_state *state, u8 reg, u32 data) static u32 count_leading_bits(s32 data) { -#if defined(__has_builtin) && __has_builtin(__builtin_clrsb) +#ifdef __has_builtin +#if __has_builtin(__builtin_clrsb) return 1 + __builtin_clrsb(data); -#else +#endif +#endif data ^= data >> 31; return data ? clz32(data) : 32; -#endif } static void lightrec_mtc2(struct lightrec_state *state, u8 reg, u32 data) -- 2.39.5