[coreboot-gerrit] New patch to review for coreboot: b9b29ef include/stdlib.h: Add macro `FIELD_SIZEOF(t, f)`

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Wed Jan 14 23:37:21 CET 2015


Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8226

-gerrit

commit b9b29efcc10aeb3bbcc1db38cb8b71985b6b4319
Author: Zhuo-Hao Lee <zhuo-hao.lee at intel.com>
Date:   Wed Jan 14 23:28:52 2015 +0100

    include/stdlib.h: Add macro `FIELD_SIZEOF(t, f)`
    
    Change-Id: I6e86025d3bbb0cd2ed82bc42b798d331046beb15
    Signed-off-by: Zhuo-Hao Lee <zhuo-hao.lee at intel.com>
    Reviewed-on: https://chromium-review.googlesource.com/237510
    Reviewed-by: Ryan Lin <ryan.lin at intel.com>
    Reviewed-by: Duncan Laurie <dlaurie at chromium.org>
    Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
 src/include/stdlib.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/include/stdlib.h b/src/include/stdlib.h
index 2fc6805..88456be 100644
--- a/src/include/stdlib.h
+++ b/src/include/stdlib.h
@@ -4,6 +4,7 @@
 #include <stddef.h>
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#define FIELD_SIZEOF(t, f) (sizeof(((t *)0)->f))
 
 #define ALIGN(x,a)              __ALIGN_MASK(x,(typeof(x))(a)-1UL)
 #define __ALIGN_MASK(x,mask)    (((x)+(mask))&~(mask))



More information about the coreboot-gerrit mailing list