Skip to content

Commit

Permalink
Merge pull request #37 from MiKom/fix-windows-minmax
Browse files Browse the repository at this point in the history
Fortify uses of std::min/max against Windows
  • Loading branch information
iamsergio authored Nov 1, 2024
2 parents 5019ab2 + 362100d commit 4b715ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cpp/duplicatetracker/include/duplicatetracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class DuplicateTrackerBase :

explicit DuplicateTrackerBase(std::size_t numBuckets, const Hash &h, const Equal &e)
#ifdef __cpp_lib_memory_resource
: Base(this->m_buffer, sizeof(this->m_buffer), std::max(numBuckets, Prealloc), h, e){}
: Base(this->m_buffer, sizeof(this->m_buffer), (std::max)(numBuckets, Prealloc), h, e){}
#else
: Base(std::max(numBuckets, Prealloc), h, e)
: Base((std::max)(numBuckets, Prealloc), h, e)
{
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion qt/KDStlContainerAdaptor/KDStlContainerAdaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ struct StdVectorAdaptor : std::vector<T, Args...>

if (len < 0)
len = s;
len = std::min(len, s - pos);
len = (std::min)(len, s - pos);

const auto b = this->begin() + pos;
const auto e = b + len;
Expand Down

0 comments on commit 4b715ce

Please sign in to comment.