summaryrefslogtreecommitdiff
path: root/lib/bitops.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2014-02-06 20:15:05 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2014-02-06 20:15:05 +0100
commit5c200e0a4d26d183e04fda43de16340521002c40 (patch)
treeb158b42840dbb723d9f34651f2f9971121d99eca /lib/bitops.h
parent4a5eb284c9d51441e09976021d1bd93c21408d46 (diff)
parent080ed4d8c2c1982dd0c81c62703064b620a67a01 (diff)
Merge branch 'add-path'
Diffstat (limited to 'lib/bitops.h')
-rw-r--r--lib/bitops.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bitops.h b/lib/bitops.h
index bebd830d..a12f6b60 100644
--- a/lib/bitops.h
+++ b/lib/bitops.h
@@ -6,6 +6,9 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
+#ifndef _BIRD_BITOPTS_H_
+#define _BIRD_BITOPTS_H_
+
/*
* Bit mask operations:
*
@@ -19,3 +22,8 @@ u32 u32_mkmask(unsigned n);
int u32_masklen(u32 x);
u32 u32_log2(u32 v);
+
+static inline u32 u32_hash(u32 v) { return v * 2902958171u; }
+
+#endif
+