diff options
author | Furquan Shaikh <furquan@google.com> | 2015-06-11 05:17:32 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-06-17 11:55:41 +0200 |
commit | 63a3e1ec7f49222c670d08424cbc7fc7f46ee7b0 (patch) | |
tree | 583b7fb33454508656ee291db1ef7e7380daad33 /payloads/libpayload | |
parent | 0cd0d28f0a4a246c0901a5e1f4685205bb683ebd (diff) | |
download | coreboot-63a3e1ec7f49222c670d08424cbc7fc7f46ee7b0.tar.gz coreboot-63a3e1ec7f49222c670d08424cbc7fc7f46ee7b0.tar.bz2 coreboot-63a3e1ec7f49222c670d08424cbc7fc7f46ee7b0.zip |
stddef: Add macro for member_size
Add macro to calculate size of a structure member
BUG=chrome-os-partner:41125
BRANCH=None
TEST=Compiles successfully
Change-Id: I71bcefe1c3b32ad559d7764e77369c67d09422a0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: b425a310c14eabad79caf97649db6469380bd602
Original-Change-Id: I377fff062729aa664f7db469b86764b0ad941c38
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/276809
Original-Reviewed-by: Jimmy Zhang <jimmzhang@nvidia.com>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: Furquan Shaikh <furquan@chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Original-Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/10560
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r-- | payloads/libpayload/include/stddef.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/payloads/libpayload/include/stddef.h b/payloads/libpayload/include/stddef.h index fca66ed24759..bb2971dd3a53 100644 --- a/payloads/libpayload/include/stddef.h +++ b/payloads/libpayload/include/stddef.h @@ -14,6 +14,7 @@ typedef __SIZE_TYPE__ ssize_t; #undef unsigned #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) +#define member_size(TYPE, MEMBER) (sizeof(((TYPE *) 0)->MEMBER)) /* Standard units. */ #define KiB (1<<10) |