summaryrefslogtreecommitdiff
path: root/lib/birdlib.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-09-12 16:33:29 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-09-12 16:33:29 +0200
commitf2dd602fef2ecf0a6598b817d71ce2ee8fadd5cc (patch)
tree5f6a44704530554148565c7f0a563ad124bd79c3 /lib/birdlib.h
parent9f4908fe78cb3e5191bca721588ee1acb10876e3 (diff)
Backport some minor changes from int-new
Diffstat (limited to 'lib/birdlib.h')
-rw-r--r--lib/birdlib.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/birdlib.h b/lib/birdlib.h
index d21cdf1f..aaa7a0a3 100644
--- a/lib/birdlib.h
+++ b/lib/birdlib.h
@@ -37,6 +37,9 @@ struct align_probe { char x; long int y; };
#define ABS(a) ((a)>=0 ? (a) : -(a))
#define DELTA(a,b) (((a)>=(b))?(a)-(b):(b)-(a))
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(*(a)))
+#define BYTES(n) ((((uint) (n)) + 7) / 8)
+#define CALL(fn, args...) ({ if (fn) fn(args); })
+#define ADVANCE(w, r, l) ({ r -= l; w += l; })
/* Bitfield macros */