From 530e9f74c4430d2123763714c8b395fdce580676 Mon Sep 17 00:00:00 2001 From: Maxime ROUFFET Date: Sun, 31 Mar 2024 10:52:40 +0900 Subject: [PATCH] [Fix] MSVC C4201 warning Temp fix MSVC C4201 warning that shouldn't trigger (using std=c11) in Rectangle2D.hpp --- CMakeLists.txt | 5 ++++- Include/SA/Maths/Geometry/Rectangle2D.hpp | 6 ++++++ ThirdParty/SA/CMakeLists.txt | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c8d578..aaf8264 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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() diff --git a/Include/SA/Maths/Geometry/Rectangle2D.hpp b/Include/SA/Maths/Geometry/Rectangle2D.hpp index 34a0482..a029c56 100644 --- a/Include/SA/Maths/Geometry/Rectangle2D.hpp +++ b/Include/SA/Maths/Geometry/Rectangle2D.hpp @@ -7,6 +7,8 @@ #include +#include + /** * \file Rectangle2D.hpp * @@ -27,6 +29,8 @@ namespace SA template struct Rect2D { + SA_PRAGMA_SDWARN_MSVC(4201) + union { /// offset. @@ -57,6 +61,8 @@ namespace SA }; }; + SA_PRAGMA_EDWARN_MSVC() + /// Default constructor. Rect2D() = default; diff --git a/ThirdParty/SA/CMakeLists.txt b/ThirdParty/SA/CMakeLists.txt index 717e709..56f0918 100644 --- a/ThirdParty/SA/CMakeLists.txt +++ b/ThirdParty/SA/CMakeLists.txt @@ -2,6 +2,9 @@ # Entrypoints +### Temp required to fix MSVC C4201 in Rectangle2D.hpp +SA_FetchModule(Support) + if(SA_MATHS_USE_LOGGER_OPT) SA_FetchModule(Logger) @@ -9,6 +12,6 @@ if(SA_MATHS_USE_LOGGER_OPT) elseif(SA_MATHS_INTRINSICS_OPT) # Support required for intrinsics. - SA_FetchModule(Support) + #SA_FetchModule(Support) endif()