chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix pause button
[disorder]
/
lib
/
bits.h
diff --git
a/lib/bits.h
b/lib/bits.h
index 856db683c2a283036f0b70db4c21c11a1a97977d..0965cb602f044f664de5edbe3392b5951feeb106 100644
(file)
--- a/
lib/bits.h
+++ b/
lib/bits.h
@@
-25,7
+25,15
@@
#ifndef BITS_H
#define BITS_H
+#include <string.h> /* for fls() */
+
+#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 */