aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/efi/Base.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2011-03-31 00:39:40 +0100
committerMichael Brown <mcb30@ipxe.org>2011-03-31 03:31:11 +0100
commit748d5ed9dae08f761643ffe1bb0ba3b6b037651f (patch)
treeae946508bbdb01b2554605e0cec72933d070e081 /src/include/ipxe/efi/Base.h
parentde2d983ab85b383d3d35cf0fb0a85f28835b09f6 (diff)
downloadipxe-748d5ed9dae08f761643ffe1bb0ba3b6b037651f.tar.gz
[efi] Synchronise EFI header files
Synchronised to EDK2 SVN revision 11462. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/efi/Base.h')
-rw-r--r--src/include/ipxe/efi/Base.h10
1 files changed, 9 insertions, 1 deletions
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