From 748d5ed9dae08f761643ffe1bb0ba3b6b037651f Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 31 Mar 2011 00:39:40 +0100 Subject: [efi] Synchronise EFI header files Synchronised to EDK2 SVN revision 11462. Signed-off-by: Michael Brown --- src/include/ipxe/efi/Base.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/include/ipxe/efi/Base.h') diff --git a/src/include/ipxe/efi/Base.h b/src/include/ipxe/efi/Base.h index d95f24bd4..999b41471 100644 --- a/src/include/ipxe/efi/Base.h +++ b/src/include/ipxe/efi/Base.h @@ -496,7 +496,7 @@ typedef CHAR8 *VA_LIST; @return A pointer to the beginning of a variable argument list. **/ -#define VA_START(Marker, Parameter) (Marker = (VA_LIST) & (Parameter) + _INT_SIZE_OF (Parameter)) +#define VA_START(Marker, Parameter) (Marker = (VA_LIST) ((UINTN) & (Parameter) + _INT_SIZE_OF (Parameter))) /** Returns an argument of a specified type from a variable argument list and updates @@ -575,7 +575,15 @@ typedef UINTN *BASE_LIST; @return Offset, in bytes, of field. **/ +#ifdef __GNUC__ +#if __GNUC__ >= 4 +#define OFFSET_OF(TYPE, Field) ((UINTN) __builtin_offsetof(TYPE, Field)) +#endif +#endif + +#ifndef OFFSET_OF #define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)->Field)) +#endif /** Macro that returns a pointer to the data structure that contains a specified field of -- cgit v1.2.3-55-g7522