]> git.proxmox.com Git - mirror_edk2.git/commitdiff
The GCC compiler’s behavior is different than the Microsoft compilers for statically...
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 8 May 2009 02:27:46 +0000 (02:27 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 8 May 2009 02:27:46 +0000 (02:27 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8260 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Base.h

index 00cce609f5622bce72c70ca9f9d3ac408487f765..69ebba345e5bfd6416ea7015bd99bd88fae0f7a9 100644 (file)
@@ -332,7 +332,20 @@ struct _LIST_ENTRY {
 //    return Result\r
 //  }\r
 //\r
+#if defined(__GNUC__)\r
+//\r
+//  In GCC compiler, its behavior for statically linked varargs is different with MSFT tool chain.\r
+//  Should use __builtin_* intrinsic functions provided by GCC compiler to access varargs.\r
+//\r
+typedef __builtin_va_list VA_LIST;\r
+\r
+#define VA_START(Marker, Parameter)  __builtin_va_start(Marker, Parameter)\r
+\r
+#define VA_ARG(Marker, TYPE)         __builtin_va_arg(Marker, TYPE)\r
 \r
+#define VA_END(Marker)               __builtin_va_end(Marker)\r
+\r
+#else\r
 /**\r
   Return the size of argument that has been aligned to sizeof (UINTN).\r
 \r
@@ -394,6 +407,8 @@ typedef CHAR8 *VA_LIST;
 **/\r
 #define VA_END(Marker)      (Marker = (VA_LIST) 0)\r
 \r
+#endif\r
+\r
 /**\r
   Macro that returns the byte offset of a field in a data structure. \r
 \r