[bug] ffs/clz/ctz builtin must be defined for long not int
#include <sys/types.h>
#define log2(x) (CHAR_BIT * sizeof(unsigned long) - __builtin_clzl(x) - 1)
-#define ffs(x) (size_t)(__builtin_ffs(x))
-#define clz(x) (size_t)(__builtin_clz(x))
-#define ctz(x) (size_t)(__builtin_ctz(x))
+#define ffs(x) ((u_long)__builtin_ffsl(x))
+#define clz(x) ((u_long)__builtin_clzl(x))
+#define ctz(x) ((u_long)__builtin_ctzl(x))
#define abs(x) \
({ \
