]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1, Use #if defined() to judge the switching macro such as compiler macro.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Feb 2009 06:09:44 +0000 (06:09 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Feb 2009 06:09:44 +0000 (06:09 +0000)
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@7597 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ebc/EdkIIGlueProcessorBind.h
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/X64/EdkIIGlueProcessorBind.h

index 52343e5d664ffbd9b98f24250e788e93484d4d3e..b31a81e9aef0dfd1b8221fe1c24cc94b9379a238 100644 (file)
@@ -28,13 +28,13 @@ Abstract:
 //  if the /OPT:REF linker option is used. We defined a macro as this is a \r
 //  a non standard extension\r
 //\r
-#if _MSC_EXTENSIONS\r
+#if defined(_MSC_EXTENSIONS)\r
   #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)\r
 #else\r
   #define GLOBAL_REMOVE_IF_UNREFERENCED\r
 #endif\r
 \r
-#ifndef MDE_CPU_EBC\r
+#if !defined(MDE_CPU_EBC)\r
   #define MDE_CPU_EBC\r
 #endif   \r
 \r
index beb31c689a9f4f7613af2f7d981ea58a87452d42..130c6b870ccd91cb93d476cbe97ea783ff605583 100644 (file)
@@ -28,13 +28,13 @@ Abstract:
 //  if the /OPT:REF linker option is used. We defined a macro as this is a \r
 //  a non standard extension\r
 //\r
-#if _MSC_EXTENSIONS\r
+#if defined(_MSC_EXTENSIONS)\r
   #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)\r
 #else\r
   #define GLOBAL_REMOVE_IF_UNREFERENCED\r
 #endif\r
 \r
-#ifndef MDE_CPU_IPF\r
+#if !defined(MDE_CPU_IPF)\r
   #define MDE_CPU_IPF\r
 #endif\r
 \r
index e362db86f50e178c5318cf95c9eab9d752da0a15..b9b6f37347a1d540dba178d1efd1037a6b2c81ae 100644 (file)
@@ -28,13 +28,13 @@ Abstract:
 //  if the /OPT:REF linker option is used. We defined a macro as this is a \r
 //  a non standard extension\r
 //\r
-#if _MSC_EXTENSIONS\r
+#if defined(_MSC_EXTENSIONS)\r
   #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)\r
 #else\r
   #define GLOBAL_REMOVE_IF_UNREFERENCED\r
 #endif\r
 \r
-#ifndef MDE_CPU_X64\r
+#if !defined(MDE_CPU_X64)\r
   #define MDE_CPU_X64\r
 #endif\r
 \r