From: notaz Date: Sun, 30 Mar 2025 00:08:06 +0000 (+0200) Subject: lightrec: fixup for old compilers X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6091efb4d64ed745495455ba82352ec82f55cb4f;p=pcsx_rearmed.git lightrec: fixup for old compilers --- 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)