summaryrefslogtreecommitdiff
path: root/datapath/linux-2.6/compat-2.6/include/linux/log2.h
blob: 69abae5e80af60257cec1ecde41f62346d61d9b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef __LINUX_LOG2_WRAPPER
#define __LINUX_LOG2_WRAPPER

#ifdef HAVE_LOG2_H
#include_next <linux/log2.h>
#else
/* This is very stripped down because log2.h has far too many dependencies. */

extern __attribute__((const, noreturn))
int ____ilog2_NaN(void);

#define ilog2(n) ((n) == 4 ? 2 : \
		  (n) == 8 ? 3 : \
		  ____ilog2_NaN())
#endif

#endif