diff options
author | Hao Wu <hao.a.wu@intel.com> | 2016-02-26 16:43:02 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-02-27 16:10:58 +0800 |
commit | d2ba6f41e2f8cbc8dffee8bddaebbbd6f3a3b9ab (patch) | |
tree | 98ec925db1d3340ae321017b5ab85513611ee48e /UefiCpuPkg | |
parent | fb9dd8322532cd71d897b3b5690a3d2268bb1603 (diff) | |
download | edk2-d2ba6f41e2f8cbc8dffee8bddaebbbd6f3a3b9ab.tar.gz edk2-d2ba6f41e2f8cbc8dffee8bddaebbbd6f3a3b9ab.tar.bz2 edk2-d2ba6f41e2f8cbc8dffee8bddaebbbd6f3a3b9ab.zip |
UefiCpuPkg/Cpuid: Fix GCC build error
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>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r-- | UefiCpuPkg/Application/Cpuid/Cpuid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c b/UefiCpuPkg/Application/Cpuid/Cpuid.c index f82e43f563..366c3ca205 100644 --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c @@ -21,7 +21,7 @@ /// Macro used to display the value of a bit field in a register returned by CPUID.
///
#define PRINT_BIT_FIELD(Variable, FieldName) \
- Print (L"%5a%42a: %x\n", #Variable, #FieldName, ##Variable.Bits.##FieldName);
+ Print (L"%5a%42a: %x\n", #Variable, #FieldName, Variable.Bits.FieldName);
///
/// Macro used to display the value of a register returned by CPUID.
|