Skip to content

Commit ce50807

Browse files
committed
Use safer CTZ guard for gcc.
1 parent b79774c commit ce50807

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/quicktions.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ cdef extern from *:
103103
#define _PyLong_GCD(a, b) (NULL)
104104
#endif
105105
106-
#ifdef __GCC__
106+
#if defined(__GCC__) && __has_builtin(__builtin_ctz) && __has_builtin(__builtin_ctzl) && __has_builtin(__builtin_ctzll)
107107
#define __Quicktions_HAS_FAST_CTZ 1
108108
#define __Quicktions_trailing_zeros_uint(x) __builtin_ctz(x)
109109
#define __Quicktions_trailing_zeros_ulong(x) __builtin_ctzl(x)

0 commit comments

Comments
 (0)