From 6ed623e4035d87e7db43677729b23844ef0e9a0d Mon Sep 17 00:00:00 2001 From: mdkinney Date: Sun, 10 May 2009 19:44:21 +0000 Subject: [PATCH] Update GCC version of VAR_ARG () to be compatible with non GCC version of VAR_ARG () so it handles TYPE parameters that are smaller than UINTN properly when GCC builtins are used for vararg parsing. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8282 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Base.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 4afdb7d84c..0e5ea1978d 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -339,11 +339,11 @@ struct _LIST_ENTRY { // typedef __builtin_va_list VA_LIST; -#define VA_START(Marker, Parameter) __builtin_va_start(Marker, Parameter) +#define VA_START(Marker, Parameter) __builtin_va_start (Marker, Parameter) -#define VA_ARG(Marker, TYPE) __builtin_va_arg(Marker, TYPE) +#define VA_ARG(Marker, TYPE) ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE))) -#define VA_END(Marker) __builtin_va_end(Marker) +#define VA_END(Marker) __builtin_va_end (Marker) #else /**