#include <algorithm>
#include <assert.h>
+#ifdef HAS_ENDIAN_H
+#include <endian.h>
+#endif
#include <limits.h>
#include <stdint.h>
#include <string.h>
return sizeof(Docid) * CHAR_BIT - __builtin_clz(x);
}
#else
- for (int i = sizeof(Docid) * CHAR_BIT; i-- > 0; ) {
- if (x & (Docid{1} << i)) {
+ for (int i = sizeof(Docid) * CHAR_BIT; i-- > 0;) {
+ if (x & (Docid{ 1 } << i)) {
return i;
}
}