summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorRussell King <rmk+cubox@arm.linux.org.uk>2013-08-27 17:49:55 +0100
committerRussell King <rmk@arm.linux.org.uk>2013-10-29 19:21:10 +0000
commit8575518800ee160f50e586b1587a727cdbade10f (patch)
tree4ba3b4a65aa541c7b1cf92093434d0d83040900f /src/utils.h
parent7164c4bd03d8dfcfaf92ec5fe50612739ab5a435 (diff)
Add common utils helpers
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
new file mode 100644
index 0000000..aa57269
--- /dev/null
+++ b/src/utils.h
@@ -0,0 +1,9 @@
+#ifndef UTILS_H
+#define UTILS_H
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+#define mint(x,y) ({(void)(&x == &y); x < y ? x : y; })
+#define maxt(x,y) ({(void)(&x == &y); x < y ? y : x; })
+
+#endif