diff options
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Include')
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h | 22 | ||||
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h | 2 | ||||
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h | 2 |
3 files changed, 26 insertions, 0 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h b/EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h index d125cedac7..989b87326b 100644 --- a/EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h +++ b/EdkCompatibilityPkg/Foundation/Include/EfiStdArg.h @@ -60,6 +60,25 @@ Abstract: #define _EFI_INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))
+#if defined(__GNUC__)
+//
+// Use GCC built-in macros for variable argument lists.
+//
+
+///
+/// Variable used to traverse the list of arguments. This type can vary by
+/// implementation and could be an array or structure.
+///
+typedef __builtin_va_list VA_LIST;
+
+#define VA_START(Marker, Parameter) __builtin_va_start (Marker, Parameter)
+
+#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)
+
+#else
+
//
// Also support coding convention rules for var arg macros
//
@@ -72,4 +91,7 @@ typedef CHAR8 *VA_LIST; #endif
+
+#endif
+
#endif
diff --git a/EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h b/EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h index 5cfbb74131..12d7154d0b 100644 --- a/EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h +++ b/EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h @@ -83,7 +83,9 @@ Abstract: //
// Make sure we are useing the correct packing rules per EFI specification
//
+#ifndef __GNUC__
#pragma pack()
+#endif
#if __INTEL_COMPILER
//
diff --git a/EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h b/EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h index a0ab02b838..14eca7a301 100644 --- a/EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h +++ b/EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h @@ -35,7 +35,9 @@ Abstract: //
// Make sure we are useing the correct packing rules per EFI specification
//
+#ifndef __GNUC__
#pragma pack()
+#endif
#if __INTEL_COMPILER
//
|