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>
/// 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