mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Fixes MSVC redefinition of min/max
Adds a compiler definition for MSVC to prevent redefinition of min/max macros by the Windows SDK. Removes unnecessary undef directives in color.hpp as the NOMINMAX definition now handles the issue.
This commit is contained in:
8
.idea/workspace.xml
generated
8
.idea/workspace.xml
generated
@@ -39,9 +39,9 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="24dcf302-ac9d-40e6-8317-7203a956ad63" name="Changes" comment="">
|
<list default="true" id="24dcf302-ac9d-40e6-8317-7203a956ad63" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/tests/general/unit_test_angles.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/tests/general/unit_test_angles.cpp" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/CMakeLists.txt" beforeDir="false" afterPath="$PROJECT_DIR$/CMakeLists.txt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/tests/general/unit_test_color.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/tests/general/unit_test_color.cpp" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/include/omath/color.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/include/omath/color.hpp" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -238,7 +238,7 @@
|
|||||||
<workItem from="1752302256186" duration="714000" />
|
<workItem from="1752302256186" duration="714000" />
|
||||||
<workItem from="1753455801202" duration="1091000" />
|
<workItem from="1753455801202" duration="1091000" />
|
||||||
<workItem from="1755627102717" duration="301000" />
|
<workItem from="1755627102717" duration="301000" />
|
||||||
<workItem from="1755723773366" duration="421000" />
|
<workItem from="1755723773366" duration="852000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -102,6 +102,11 @@ elseif (OMATH_THREAT_WARNING_AS_ERROR)
|
|||||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# Windows SDK redefine min/max via preprocessor and break std::min and std::max
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
target_compile_definitions(${PROJECT_NAME} INTERFACE NOMINMAX)
|
||||||
|
endif ()
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME}
|
target_include_directories(${PROJECT_NAME}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> # Use this path when building the project
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> # Use this path when building the project
|
||||||
|
|||||||
@@ -8,14 +8,6 @@
|
|||||||
#include "omath/vector4.hpp"
|
#include "omath/vector4.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#ifdef max
|
|
||||||
#undef max
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef min
|
|
||||||
#undef min
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
struct Hsv
|
struct Hsv
|
||||||
|
|||||||
Reference in New Issue
Block a user