chiark / gitweb /
Merge from disorder.4.0 up to 4.0.1
[disorder] / lib / bits.h
index 856db683c2a283036f0b70db4c21c11a1a97977d..e0f7c6289991d093833e2886588a3315aca9d0a8 100644 (file)
 #ifndef BITS_H
 #define BITS_H
 
+#if HAVE_FLS
+static inline int leftmost_bit(uint32_t n) {
+  return fls(n) - 1;
+}
+#else
 int leftmost_bit(uint32_t n);
+#endif
 
 #endif /* BITS_H */