Skip to content

Commit

Permalink
[Fix] MSVC C4201 warning
Browse files Browse the repository at this point in the history
Temp fix MSVC C4201 warning that shouldn't trigger (using std=c11) in Rectangle2D.hpp
  • Loading branch information
mrouffet committed Mar 31, 2024
1 parent 9b13e57 commit 530e9f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ add_library(SA_Maths STATIC)
SA_ConfigureTarget(SA_Maths)
SA_TargetSources(SA_Maths)

### Temp required to fix MSVC C4201 in Rectangle2D.hpp
target_link_libraries(SA_Maths PUBLIC SA_Support)



# Option
Expand All @@ -37,7 +40,7 @@ endif()
option(SA_MATHS_INTRINSICS_OPT "Should build using intrinsics" OFF)

if(SA_MATHS_INTRINSICS_OPT)
target_link_libraries(SA_Maths PUBLIC SA_Support)
#target_link_libraries(SA_Maths PUBLIC SA_Support)
target_compile_definitions(SA_Maths PUBLIC SA_MATHS_INTRINSICS_OPT)
SA_SetIntrinsicsFlags(SA_Maths)
endif()
Expand Down
6 changes: 6 additions & 0 deletions Include/SA/Maths/Geometry/Rectangle2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <SA/Maths/Space/Vector2.hpp>

#include <SA/Support/Pragma.hpp>

/**
* \file Rectangle2D.hpp
*
Expand All @@ -27,6 +29,8 @@ namespace SA
template <typename T>
struct Rect2D
{
SA_PRAGMA_SDWARN_MSVC(4201)

union
{
/// offset.
Expand Down Expand Up @@ -57,6 +61,8 @@ namespace SA
};
};

SA_PRAGMA_EDWARN_MSVC()

/// Default constructor.
Rect2D() = default;

Expand Down
5 changes: 4 additions & 1 deletion ThirdParty/SA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

# Entrypoints

### Temp required to fix MSVC C4201 in Rectangle2D.hpp
SA_FetchModule(Support)

if(SA_MATHS_USE_LOGGER_OPT)

SA_FetchModule(Logger)

elseif(SA_MATHS_INTRINSICS_OPT)

# Support required for intrinsics.
SA_FetchModule(Support)
#SA_FetchModule(Support)

endif()

0 comments on commit 530e9f7

Please sign in to comment.