69abae5e80af60257cec1ecde41f62346d61d9b3
[sliver-openvswitch.git] / datapath / linux-2.6 / compat-2.6 / include / linux / log2.h
1 #ifndef __LINUX_LOG2_WRAPPER
2 #define __LINUX_LOG2_WRAPPER
3
4 #ifdef HAVE_LOG2_H
5 #include_next <linux/log2.h>
6 #else
7 /* This is very stripped down because log2.h has far too many dependencies. */
8
9 extern __attribute__((const, noreturn))
10 int ____ilog2_NaN(void);
11
12 #define ilog2(n) ((n) == 4 ? 2 : \
13                   (n) == 8 ? 3 : \
14                   ____ilog2_NaN())
15 #endif
16
17 #endif