summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2023-05-30 10:11:24 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-03 06:25:32 +0000
commitda1084ccf4ca79f8a0ac3e39e86aa27dbb9978e7 (patch)
tree90e57662585fc85946fb631b38444112432f79c2
parente6a886fdfc83503628a816d09c6e6a2a3d2ed88c (diff)
downloadedk2-da1084ccf4ca79f8a0ac3e39e86aa27dbb9978e7.tar.gz
MdePkg/Include/IndustryStandard: Address C++ keyword collisions
Update Tpm12.h and Tpm20.h and not use c++ reserved keywords operator and xor in C structures to support use of these include files when building with a C++ compiler. This patch removes the temporary use of anonymous unions and warning 4201 disable for VS20xx tool chains to complete the following field name changes: * operator -> operator_ * xor -> xor_ NOTE: This is a non-backwards compatible change to Tpm12.h and Tmp20.h. And consumers of these include files that access the "operator" or "xor" fields must be updated. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
-rw-r--r--MdePkg/Include/IndustryStandard/Tpm12.h20
-rw-r--r--MdePkg/Include/IndustryStandard/Tpm20.h25
2 files changed, 3 insertions, 42 deletions
diff --git a/MdePkg/Include/IndustryStandard/Tpm12.h b/MdePkg/Include/IndustryStandard/Tpm12.h
index 0e5a9019e8..0435bebe8e 100644
--- a/MdePkg/Include/IndustryStandard/Tpm12.h
+++ b/MdePkg/Include/IndustryStandard/Tpm12.h
@@ -10,14 +10,6 @@
#define _TPM12_H_
///
-/// Temporary disable 4201 to support anonymous unions
-///
-#if defined (_MSC_EXTENSIONS)
-#pragma warning( push )
-#pragma warning ( disable : 4201 )
-#endif
-
-///
/// The start of TPM return codes
///
#define TPM_BASE 0
@@ -752,10 +744,7 @@ typedef struct tdTPM_PERMANENT_FLAGS {
BOOLEAN TPMpost;
BOOLEAN TPMpostLock;
BOOLEAN FIPS;
- union {
- BOOLEAN operator;
- BOOLEAN operator_;
- };
+ BOOLEAN operator_;
BOOLEAN enableRevokeEK;
BOOLEAN nvLocked;
BOOLEAN readSRKPub;
@@ -2173,11 +2162,4 @@ typedef struct tdTPM_RSP_COMMAND_HDR {
#pragma pack ()
-///
-/// Temporary disable 4201 to support anonymous unions
-///
-#if defined (_MSC_EXTENSIONS)
-#pragma warning( pop )
-#endif
-
#endif
diff --git a/MdePkg/Include/IndustryStandard/Tpm20.h b/MdePkg/Include/IndustryStandard/Tpm20.h
index 52092bd614..609b727ac8 100644
--- a/MdePkg/Include/IndustryStandard/Tpm20.h
+++ b/MdePkg/Include/IndustryStandard/Tpm20.h
@@ -15,14 +15,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <IndustryStandard/Tpm12.h>
-///
-/// Temporary disable 4201 to support anonymous unions
-///
-#if defined (_MSC_EXTENSIONS)
-#pragma warning( push )
-#pragma warning ( disable : 4201 )
-#endif
-
#pragma pack (1)
// Annex A Algorithm Constants
@@ -1256,10 +1248,7 @@ typedef union {
TPMI_AES_KEY_BITS aes;
TPMI_SM4_KEY_BITS SM4;
TPM_KEY_BITS sym;
- union {
- TPMI_ALG_HASH xor;
- TPMI_ALG_HASH xor_;
- };
+ TPMI_ALG_HASH xor_;
} TPMU_SYM_KEY_BITS;
// Table 123 - TPMU_SYM_MODE Union
@@ -1332,10 +1321,7 @@ typedef struct {
// Table 136 - TPMU_SCHEME_KEYEDHASH Union
typedef union {
TPMS_SCHEME_HMAC hmac;
- union {
- TPMS_SCHEME_XOR xor;
- TPMS_SCHEME_XOR xor_;
- };
+ TPMS_SCHEME_XOR xor_;
} TPMU_SCHEME_KEYEDHASH;
// Table 137 - TPMT_KEYEDHASH_SCHEME Structure
@@ -1824,11 +1810,4 @@ typedef struct {
#define HASH_ALG_SHA512 0x00000008
#define HASH_ALG_SM3_256 0x00000010
-///
-/// Temporary disable 4201 to support anonymous unions
-///
-#if defined (_MSC_EXTENSIONS)
-#pragma warning( pop )
-#endif
-
#endif