From 63a3e1ec7f49222c670d08424cbc7fc7f46ee7b0 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Thu, 11 Jun 2015 05:17:32 -0700 Subject: stddef: Add macro for member_size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Original-Commit-Id: b425a310c14eabad79caf97649db6469380bd602 Original-Change-Id: I377fff062729aa664f7db469b86764b0ad941c38 Original-Signed-off-by: Furquan Shaikh Original-Reviewed-on: https://chromium-review.googlesource.com/276809 Original-Reviewed-by: Jimmy Zhang Original-Reviewed-by: Aaron Durbin Original-Tested-by: Furquan Shaikh Original-Commit-Queue: Furquan Shaikh Original-Trybot-Ready: Furquan Shaikh Reviewed-on: http://review.coreboot.org/10560 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Paul Menzel --- payloads/libpayload/include/stddef.h | 1 + 1 file changed, 1 insertion(+) (limited to 'payloads/libpayload/include/stddef.h') diff --git a/payloads/libpayload/include/stddef.h b/payloads/libpayload/include/stddef.h index fca66ed247..bb2971dd3a 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) -- cgit v1.2.3