diff options
Diffstat (limited to 'src/commonlib/include')
-rw-r--r-- | src/commonlib/include/commonlib/helpers.h | 6 | ||||
-rw-r--r-- | src/commonlib/include/commonlib/region.h | 1 |
2 files changed, 7 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 */ diff --git a/src/commonlib/include/commonlib/region.h b/src/commonlib/include/commonlib/region.h index 35d48ade85..a13c66c316 100644 --- a/src/commonlib/include/commonlib/region.h +++ b/src/commonlib/include/commonlib/region.h @@ -16,6 +16,7 @@ #ifndef _REGION_H_ #define _REGION_H_ +#include <sys/types.h> #include <stdint.h> #include <stddef.h> #include <commonlib/mem_pool.h> |