Skip to content

Commit

Permalink
Fix compliation of TestSWMaterialSaver DirectX operator==
Browse files Browse the repository at this point in the history
  • Loading branch information
nieznanysprawiciel committed Oct 12, 2024
1 parent 98f2653 commit 74be88f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions swCommonLib/Common/Macros/GenerateOperators.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ namespace sw
#define _APPEND_INSTANCE_OBJ2( member ) _APPEND_INSTANCE( obj2, member )

#define _GENERATE_OPERATOR( OP, ClassType, ... ) \
inline bool operator##OP( const ClassType& obj1, const ClassType& obj2 )\
{ \
return std::tie( FOR_EACH( _APPEND_INSTANCE_OBJ1, __VA_ARGS__ ) ) \
OP std::tie( FOR_EACH( _APPEND_INSTANCE_OBJ2, __VA_ARGS__ ) ); \
}
inline static bool operator##OP( const ClassType& obj1, const ClassType& obj2 ) \
{ \
return std::tie( FOR_EACH( _APPEND_INSTANCE_OBJ1, __VA_ARGS__ ) ) \
OP std::tie( FOR_EACH( _APPEND_INSTANCE_OBJ2, __VA_ARGS__ ) ); \
} \


/**@brief Generates operator== function for ClassType.
Pass all class members as variadic parameters.*/
Expand Down
6 changes: 4 additions & 2 deletions swGraphicAPI/Tests/TestMaterial/TestSWMaterialSaver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ using namespace sw;
// Material test utils
//====================================================================================//

GENERATE_RELATIONAL_OPERATORS( DirectX::XMFLOAT3, x, y, z );
GENERATE_RELATIONAL_OPERATORS( DirectX::XMFLOAT4, x, y, z, w );
namespace DirectX {
GENERATE_RELATIONAL_OPERATORS(DirectX::XMFLOAT3, x, y, z);
GENERATE_RELATIONAL_OPERATORS(DirectX::XMFLOAT4, x, y, z, w);
}


// ================================ //
Expand Down

0 comments on commit 74be88f

Please sign in to comment.