]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/Cpuid: Fix GCC build error
authorHao Wu <hao.a.wu@intel.com>
Fri, 26 Feb 2016 08:43:02 +0000 (16:43 +0800)
committerHao Wu <hao.a.wu@intel.com>
Sat, 27 Feb 2016 08:10:58 +0000 (16:10 +0800)
define PRINT_BIT_FIELD(Variable, FieldName) \
  Print (L"%5a%42a: %x\n", #Variable, #FieldName, \
  ##Variable.Bits.##FieldName);

The above definition in UefiCpuPkg/Application/Cpuid/Cpuid.c
will cause GCC build error.

Fix it with:

define PRINT_BIT_FIELD(Variable, FieldName) \
  Print (L"%5a%42a: %x\n", #Variable, #FieldName, \
  Variable.Bits.FieldName);

The '.' has its origin meaning as a member operator in the define
statement. Thus, the token-pasting operator '##' is not necessary here.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
UefiCpuPkg/Application/Cpuid/Cpuid.c

index f82e43f563ad41f2b5af2e132869c99a8457bb3d..366c3ca2050402531f9e06bd936b01999ed45edf 100644 (file)
@@ -21,7 +21,7 @@
 /// Macro used to display the value of a bit field in a register returned by CPUID.\r
 ///\r
 #define PRINT_BIT_FIELD(Variable, FieldName) \\r
 /// Macro used to display the value of a bit field in a register returned by CPUID.\r
 ///\r
 #define PRINT_BIT_FIELD(Variable, FieldName) \\r
-  Print (L"%5a%42a: %x\n", #Variable, #FieldName, ##Variable.Bits.##FieldName);\r
+  Print (L"%5a%42a: %x\n", #Variable, #FieldName, Variable.Bits.FieldName);\r
 \r
 ///\r
 /// Macro used to display the value of a register returned by CPUID.\r
 \r
 ///\r
 /// Macro used to display the value of a register returned by CPUID.\r