]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Base.h
MdePkg: Fix some typing errors in the header files
[mirror_edk2.git] / MdePkg / Include / Base.h
index cbd9e552d0464653354b8a5a7db5735d7a0c7675..c66614846488861ec71354df454e8d08d9fabca2 100644 (file)
@@ -89,10 +89,11 @@ VERIFY_SIZE_OF (CHAR16, 2);
 // warnings.\r
 //\r
 #ifndef UNREACHABLE\r
-  #ifdef __GNUC__\r
+  #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)\r
     ///\r
     /// Signal compilers and analyzers that this call is not reachable.  It is\r
     /// up to the compiler to remove any code past that point.\r
+    /// Not implemented by GCC 4.4 or earlier.\r
     ///\r
     #define UNREACHABLE()  __builtin_unreachable ()\r
   #elif defined (__has_feature)\r
@@ -301,7 +302,7 @@ struct _LIST_ENTRY {
 \r
 //\r
 //  UEFI specification claims 1 and 0. We are concerned about the\r
-//  complier portability so we did it this way.\r
+//  compiler portability so we did it this way.\r
 //\r
 \r
 ///\r
@@ -588,7 +589,31 @@ struct _LIST_ENTRY {
 \r
 #define VA_COPY(Dest, Start)          __va_copy (Dest, Start)\r
 \r
-#elif defined(__GNUC__) && !defined(NO_BUILTIN_VA_FUNCS)\r
+#elif defined(__GNUC__)\r
+\r
+#if defined(MDE_CPU_X64) && !defined(NO_MSABI_VA_FUNCS)\r
+//\r
+// X64 only. Use MS ABI version of GCC built-in macros for variable argument lists.\r
+//\r
+///\r
+/// Both GCC and LLVM 3.8 for X64 support new variable argument intrinsics for Microsoft ABI\r
+///\r
+\r
+///\r
+/// Variable used to traverse the list of arguments. This type can vary by\r
+/// implementation and could be an array or structure.\r
+///\r
+typedef __builtin_ms_va_list VA_LIST;\r
+\r
+#define VA_START(Marker, Parameter)  __builtin_ms_va_start (Marker, Parameter)\r
+\r
+#define VA_ARG(Marker, TYPE)         ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE)))\r
+\r
+#define VA_END(Marker)               __builtin_ms_va_end (Marker)\r
+\r
+#define VA_COPY(Dest, Start)         __builtin_ms_va_copy (Dest, Start)\r
+\r
+#else\r
 //\r
 // Use GCC built-in macros for variable argument lists.\r
 //\r
@@ -607,6 +632,8 @@ typedef __builtin_va_list VA_LIST;
 \r
 #define VA_COPY(Dest, Start)         __builtin_va_copy (Dest, Start)\r
 \r
+#endif\r
+\r
 #else\r
 ///\r
 /// Variable used to traverse the list of arguments. This type can vary by\r
@@ -1146,7 +1173,7 @@ typedef UINTN RETURN_STATUS;
 #if defined(_MSC_EXTENSIONS) && !defined (__INTEL_COMPILER) && !defined (MDE_CPU_EBC)\r
   #pragma intrinsic(_ReturnAddress)\r
   /**\r
-    Get the return address of the calling funcation.\r
+    Get the return address of the calling function.\r
 \r
     Based on intrinsic function _ReturnAddress that provides the address of\r
     the instruction in the calling function that will be executed after\r
@@ -1154,27 +1181,27 @@ typedef UINTN RETURN_STATUS;
 \r
     @param L    Return Level.\r
 \r
-    @return The return address of the calling funcation or 0 if L != 0.\r
+    @return The return address of the calling function or 0 if L != 0.\r
 \r
   **/\r
   #define RETURN_ADDRESS(L)     ((L == 0) ? _ReturnAddress() : (VOID *) 0)\r
 #elif defined(__GNUC__)\r
   void * __builtin_return_address (unsigned int level);\r
   /**\r
-    Get the return address of the calling funcation.\r
+    Get the return address of the calling function.\r
 \r
     Based on built-in Function __builtin_return_address that returns\r
     the return address of the current function, or of one of its callers.\r
 \r
     @param L    Return Level.\r
 \r
-    @return The return address of the calling funcation.\r
+    @return The return address of the calling function.\r
 \r
   **/\r
   #define RETURN_ADDRESS(L)     __builtin_return_address (L)\r
 #else\r
   /**\r
-    Get the return address of the calling funcation.\r
+    Get the return address of the calling function.\r
 \r
     @param L    Return Level.\r
 \r