]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h
Fixed issues compiling for Apple gcc on IA-32
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Include / Ia32 / EfiBind.h
index 7c3c585b9e4fe528d3e05aafd4ed8d390d06a238..12d7154d0baef7754124cbf5290523d41869fb3d 100644 (file)
@@ -83,7 +83,9 @@ Abstract:
 //\r
 // Make sure we are useing the correct packing rules per EFI specification\r
 //\r
+#ifndef __GNUC__\r
 #pragma pack()\r
+#endif\r
 \r
 #if __INTEL_COMPILER\r
 //\r
@@ -114,6 +116,12 @@ Abstract:
 //\r
 #pragma warning ( disable : 1419 )\r
 \r
+//\r
+// Disable ICC's remark #869: "Parameter" was never referenced warning.\r
+// This is legal ANSI C code so we disable the remark that is turned on with -Wall\r
+//\r
+#pragma warning ( disable : 869 )\r
+\r
 #endif\r
 \r
 \r
@@ -235,7 +243,12 @@ typedef int32_t   intn_t;
 // compiler will optimize away the rest of the function following, so that you run out in\r
 // the weeds if you skip over it with a debugger.\r
 //\r
+#ifdef _MSC_EXTENSIONS\r
 #define EFI_BREAKPOINT()  __asm { int 3 }\r
+#elif __GNUC__\r
+#define EFI_BREAKPOINT() asm("   int $3");\r
+#endif\r
+\r
 #define EFI_DEADLOOP()    { volatile UINTN __iii; __iii = 1; while (__iii); }\r
 \r
 //\r
@@ -295,7 +308,23 @@ typedef int32_t   intn_t;
 \r
 #endif\r
 \r
+//\r
+// For symbol name in GNU assembly code, an extra "_" is necessary\r
+//\r
+#if defined(__GNUC__)\r
+  ///\r
+  /// Private worker functions for ASM_PFX()\r
+  ///\r
+  #define _CONCATENATE(a, b)  __CONCATENATE(a, b)\r
+  #define __CONCATENATE(a, b) a ## b\r
 \r
+  ///\r
+  /// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix\r
+  /// on symbols in assembly language.\r
+  ///\r
+  #define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)\r
+\r
+#endif\r
 \r
 #endif\r
 \r