[coreboot-gerrit] New patch to review for coreboot: stddef: Add macro for member_size

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Tue Jun 16 12:32:10 CEST 2015

Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10560


commit efc23095019b3573c77f4ab0249298804b7d4a40
Author: Furquan Shaikh <furquan at google.com>
Date:   Thu Jun 11 05:17:32 2015 -0700

    stddef: Add macro for member_size
    Add macro to calculate size of a structure member
    TEST=Compiles successfully
    Change-Id: I71bcefe1c3b32ad559d7764e77369c67d09422a0
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: b425a310c14eabad79caf97649db6469380bd602
    Original-Change-Id: I377fff062729aa664f7db469b86764b0ad941c38
    Original-Signed-off-by: Furquan Shaikh <furquan at google.com>
    Original-Reviewed-on: https://chromium-review.googlesource.com/276809
    Original-Reviewed-by: Jimmy Zhang <jimmzhang at nvidia.com>
    Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
    Original-Tested-by: Furquan Shaikh <furquan at chromium.org>
    Original-Commit-Queue: Furquan Shaikh <furquan at chromium.org>
    Original-Trybot-Ready: Furquan Shaikh <furquan at chromium.org>
 payloads/libpayload/include/stddef.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/payloads/libpayload/include/stddef.h b/payloads/libpayload/include/stddef.h
index fca66ed..bb2971d 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)

More information about the coreboot-gerrit mailing list