Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-25 Thread Michael D Kinney
those fields. Thanks, Mike > -Original Message- > From: Pedro Falcato > Sent: Thursday, May 25, 2023 11:01 AM > To: Oliver Smith-Denny > Cc: devel@edk2.groups.io; Kinney, Michael D ; > Pop, Aaron > Subject: Re: [edk2-devel] GoogleTest Compatibility with MdePkg'

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-25 Thread Pedro Falcato
On Thu, May 25, 2023 at 6:43 PM Oliver Smith-Denny wrote: > > Hi Mike, > > Thanks for looking for solutions here. This one feels like > quite a back bend, I'm imagining reading code and coming > across TpmStruct.CPLUSPLUS_OPERATOR_KEYWORD and having to > dig around quite a lot to see what goodness

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-25 Thread Oliver Smith-Denny
SCHEME_XOR CPLUSPLUS_XOR_KEYWORD; } TPMU_SCHEME_KEYEDHASH; // Table 137 - TPMT_KEYEDHASH_SCHEME Structure Mike -Original Message- From: Pedro Falcato Sent: Thursday, May 25, 2023 2:44 AM To: devel@edk2.groups.io; Kinney, Michael D Cc: Pop, Aaron Subject: Re: [edk2-devel] GoogleTest Compatib

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-25 Thread Michael D Kinney
; } TPMU_SCHEME_KEYEDHASH; // Table 137 - TPMT_KEYEDHASH_SCHEME Structure Mike > -Original Message- > From: Pedro Falcato > Sent: Thursday, May 25, 2023 2:44 AM > To: devel@edk2.groups.io; Kinney, Michael D > Cc: Pop, Aaron > Subject: Re: [edk2-devel] GoogleTest Compatibi

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-24 Thread Michael D Kinney
s that error. Mike > -Original Message- > From: devel@edk2.groups.io On Behalf Of Pedro > Falcato > Sent: Wednesday, May 24, 2023 2:55 PM > To: devel@edk2.groups.io; Kinney, Michael D > Cc: Pop, Aaron > Subject: Re: [edk2-devel] GoogleTest Compatibility with MdePkg's &

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-24 Thread Pedro Falcato
On Wed, May 24, 2023 at 10:23 PM Michael D Kinney wrote: > > After trying a few GCC experiments, there does not appear to be any way to > work around “xor” keyword. > > > > I recommend we update EDK II sources to not use c++ keywords to avoid this > issue all together. > > > > This may require c

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-24 Thread Michael D Kinney
After trying a few GCC experiments, there does not appear to be any way to work around "xor" keyword. I recommend we update EDK II sources to not use c++ keywords to avoid this issue all together. This may require changes that do not match names from industry standard specs. Mike From: Aaron

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-24 Thread Aaron Pop via groups.io
Hi Mike, What you suggested does work for MSVC, but it is failing with GCC. It sems that GCC is very strict about operator names. Relevant errors below: error: "xor" cannot be used as a macro name as it is an operator in C++ #define xor XOR ^~~ error: "xor" cannot be used a

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-24 Thread Michael D Kinney
Hi Aaron, Don't know if this will completely resolve your issues, but if you add some preprocessor statements around the problematic includes in your unit test CPP file, you may be able to get it to build. For example, I added the highlighted lines to MdePkg\Test\GoogleTest\Library\BaseSafeInt

[edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-22 Thread Aaron Pop via groups.io
Google Test, and CPP, has more keywords C uses. Tpm12.h and Tpm20.h have references to struct names that are `operator` and `xor`, both of which trigger build errors because they conflict with CPP's keywords. Operator triggered a build error in MSVC. Xor only triggered a build error under GCC