diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-23 05:51:02 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-23 05:51:02 +0000 |
commit | 5cfbd055878dcca6f3e4081fc5c8805fd2ce7107 (patch) | |
tree | 541c3b9bb643efbcb30860fd2460223f3ae5f4f0 /MdePkg/Include/X64 | |
parent | 04985a579c321272ba3cb5790f1ed5dc698616c4 (diff) | |
download | edk2-platforms-5cfbd055878dcca6f3e4081fc5c8805fd2ce7107.tar.xz |
1, Use #if defined() to judge the switching macro such as compiler macro.
Original, some code directly judge the value of these macros, but linux ICC compiler will report error as "zero used for undefined preprocessing identifier". So it is better judge whether these macros are defined before accessing their value.
2, Use #if defined() style to replace #ifdef style.
It is good to keep consistent style for this case.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7596 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include/X64')
-rw-r--r-- | MdePkg/Include/X64/ProcessorBind.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/MdePkg/Include/X64/ProcessorBind.h b/MdePkg/Include/X64/ProcessorBind.h index f1b0339a12..71f5277538 100644 --- a/MdePkg/Include/X64/ProcessorBind.h +++ b/MdePkg/Include/X64/ProcessorBind.h @@ -24,12 +24,12 @@ //
// Make sure we are using the correct packing rules per EFI specification
//
-#ifndef __GNUC__
+#if !defined(__GNUC__)
#pragma pack()
#endif
-#if __INTEL_COMPILER
+#if defined(__INTEL_COMPILER)
//
// Disable ICC's remark #869: "Parameter" was never referenced warning.
// This is legal ANSI C code so we disable the remark that is turned on with -Wall
@@ -51,7 +51,7 @@ #endif
-#if _MSC_EXTENSIONS
+#if defined(_MSC_EXTENSIONS)
//
// Disable warning that make it impossible to compile at /W4
@@ -97,7 +97,7 @@ // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
//
- #if _MSC_EXTENSIONS
+ #if defined(_MSC_EXTENSIONS)
//
// use Microsoft C complier dependent integer width types
//
@@ -149,7 +149,7 @@ ///
typedef char INT8;
#else
- #ifdef _EFI_P64
+ #if defined(_EFI_P64)
//
// P64 - pointers being 64-bit and longs and ints are 32-bits.
//
@@ -348,12 +348,12 @@ typedef INT64 INTN; // use the correct C calling convention. All protocol member functions and
// EFI intrinsics are required to modify their member functions with EFIAPI.
//
-#if _MSC_EXTENSIONS
+#if defined(_MSC_EXTENSIONS)
///
/// Microsoft* compiler specific method for EFIAPI calling convension
///
#define EFIAPI __cdecl
-#elif __GNUC__
+#elif defined(__GNUC__)
///
/// Define the standard calling convention reguardless of optimization level.
/// The GCC support assumes a GCC compiler that supports the EFI ABI. The EFI
@@ -376,7 +376,7 @@ typedef INT64 INTN; // if the /OPT:REF linker option is used. We defined a macro as this is a
// a non standard extension
//
-#if _MSC_EXTENSIONS
+#if defined(_MSC_EXTENSIONS)
///
/// Remove global variable from the linked image if there are no references to
/// it after all compiler and linker optimizations have been performed.
@@ -395,7 +395,7 @@ typedef INT64 INTN; //
// For symbol name in GNU assembly code, an extra "_" is necessary
//
-#if __GNUC__
+#if defined(__GNUC__)
#if defined(linux)
#define ASM_PFX(name) name
#else
|