That is exactly what I did. Along with pragma to disable error on macros redefining operators.
With that change use of "operator" did not generate a warning or error and the build completed. Did not work for "xor", and can not find any additional pragma to suppress that error. Mike > -----Original Message----- > From: devel@edk2.groups.io <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 <michael.d.kin...@intel.com> > Cc: Pop, Aaron <aaron...@microsoft.com> > Subject: Re: [edk2-devel] GoogleTest Compatibility with MdePkg's > IndustyStandard header files > > On Wed, May 24, 2023 at 10:23 PM Michael D Kinney > <michael.d.kin...@intel.com> 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 changes that do not match names from industry standard > specs. > > This is a crappy problem but it's workaroundable in the header by > using something like: > > #ifdef __cplusplus > #define SOME_MEMBER_NAME alternative_name > #else > #define SOME_MEMBER_NAME bad_name > #endif > > and then in the struct... > > struct Foo > { > UINTN SOME_MEMBER_NAME; > }; > > > It should work around these C++ issues while keeping compat with existing > code. > Although yes, avoiding C++ keywords is a good idea, particularly if > you're planning to bring more C++ into edk2. > > -- > Pedro > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105287): https://edk2.groups.io/g/devel/message/105287 Mute This Topic: https://groups.io/mt/99079638/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-