aboutsummaryrefslogtreecommitdiff
path: root/src/commonlib/include/commonlib/helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/commonlib/include/commonlib/helpers.h')
-rw-r--r--src/commonlib/include/commonlib/helpers.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/commonlib/include/commonlib/helpers.h b/src/commonlib/include/commonlib/helpers.h
index 0e337c9ce7..646a66f30d 100644
--- a/src/commonlib/include/commonlib/helpers.h
+++ b/src/commonlib/include/commonlib/helpers.h
@@ -2,7 +2,9 @@
#define COMMONLIB_HELPERS_H
/* This file is for helpers for both coreboot firmware and its utilities. */
+#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#endif
#define ALIGN(x,a) __ALIGN_MASK(x,(__typeof__(x))(a)-1UL)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
@@ -54,4 +56,8 @@
const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
+#ifndef __unused
+#define __unused __attribute__((unused))
+#endif
+
#endif /* COMMONLIB_HELPERS_H */