Skip to content

Commit 0ab87f5

Browse files
committed
COMP: Guard Extent.hpp against Windows.h min/max macros
* Undef min and max at the top of Extent.hpp so MSVC's transitively included Windows.h macros do not expand against the struct's member names in the constructor initializer list * Fixes cascading fmt/color.h namespace errors on v143 Windows builds caused by MSVC losing its parse state after the Extent syntax error * Re-sort includes in AbstractDataStore.hpp to satisfy clang-format Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
1 parent 3a88bbf commit 0ab87f5

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/simplnx/Common/Extent.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88
#include <stdexcept>
99
#include <vector>
1010

11+
// Windows.h (pulled in transitively on MSVC builds) defines min/max as function-like
12+
// macros, which collide with the public member names below. Undef them so the member
13+
// declarations parse correctly and so std::min/std::max inside the inline methods are
14+
// not expanded.
15+
#ifdef min
16+
#undef min
17+
#endif
18+
#ifdef max
19+
#undef max
20+
#endif
21+
1122
namespace nx::core
1223
{
1324
struct Extent

src/simplnx/DataStructure/AbstractDataStore.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#include "simplnx/Common/Result.hpp"
43
#include "simplnx/Common/Extent.hpp"
4+
#include "simplnx/Common/Result.hpp"
55
#include "simplnx/Common/StringLiteralFormatting.hpp"
66
#include "simplnx/Common/TypesUtility.hpp"
77
#include "simplnx/DataStructure/IDataStore.hpp"

0 commit comments

Comments
 (0)