Skip to content

Commit

Permalink
fix: enable support for min/max macros
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrechette committed Nov 21, 2023
1 parent 41da874 commit 7dd3dd8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions includes/acl/compression/impl/track_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ namespace acl

rtm::quatf RTM_SIMD_CALL get_sample_clamped(uint32_t sample_index) const
{
return get_sample(std::min(sample_index, m_num_samples - 1));
return get_sample((std::min)(sample_index, m_num_samples - 1));
}
};

Expand Down Expand Up @@ -298,7 +298,7 @@ namespace acl

rtm::vector4f RTM_SIMD_CALL get_sample_clamped(uint32_t sample_index) const
{
return get_sample(std::min(sample_index, m_num_samples - 1));
return get_sample((std::min)(sample_index, m_num_samples - 1));
}
};

Expand Down Expand Up @@ -338,7 +338,7 @@ namespace acl

rtm::vector4f RTM_SIMD_CALL get_sample_clamped(uint32_t sample_index) const
{
return get_sample(std::min(sample_index, m_num_samples - 1));
return get_sample((std::min)(sample_index, m_num_samples - 1));
}
};

Expand Down
4 changes: 2 additions & 2 deletions includes/acl/core/bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ namespace acl
template<uint64_t num_bits>
static constexpr bitset_description make_from_num_bits()
{
static_assert(num_bits <= std::numeric_limits<uint32_t>::max() - 31, "Number of bits exceeds the maximum number allowed");
static_assert(num_bits <= (std::numeric_limits<uint32_t>::max)() - 31, "Number of bits exceeds the maximum number allowed");
return bitset_description((uint32_t(num_bits) + 32 - 1) / 32);
}

////////////////////////////////////////////////////////////////////////////////
// Creates a bit set description from a runtime known number of bits.
inline static bitset_description make_from_num_bits(uint32_t num_bits)
{
ACL_ASSERT(num_bits <= std::numeric_limits<uint32_t>::max() - 31, "Number of bits exceeds the maximum number allowed");
ACL_ASSERT(num_bits <= (std::numeric_limits<uint32_t>::max)() - 31, "Number of bits exceeds the maximum number allowed");
return bitset_description((num_bits + 32 - 1) / 32);
}

Expand Down
4 changes: 2 additions & 2 deletions includes/acl/core/impl/interpolation_utils.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace acl
uint32_t sample_index1;
if (looping_policy == sample_looping_policy::clamp)
{
sample_index1 = std::min(next_sample_index, last_sample_index);
sample_index1 = (std::min)(next_sample_index, last_sample_index);
ACL_ASSERT(sample_index0 <= sample_index1 && sample_index1 < num_samples, "Invalid sample indices: 0 <= %u <= %u < %u", sample_index0, sample_index1, num_samples);
}
else
Expand Down Expand Up @@ -172,7 +172,7 @@ namespace acl
uint32_t sample_index1;
if (looping_policy == sample_looping_policy::clamp)
{
sample_index1 = std::min(next_sample_index, last_sample_index);
sample_index1 = (std::min)(next_sample_index, last_sample_index);
ACL_ASSERT(sample_index0 <= sample_index1 && sample_index1 < num_samples, "Invalid sample indices: 0 <= %u <= %u < %u", sample_index0, sample_index1, num_samples);
}
else
Expand Down
2 changes: 1 addition & 1 deletion includes/acl/core/memory_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ namespace acl
else if (static_condition<std::is_signed<SrcRealType>::value>::test())
return int64_t(input) >= 0 && SrcType(DstType(input)) == input;
else
return uint64_t(input) <= uint64_t(std::numeric_limits<DstType>::max());
return uint64_t(input) <= uint64_t((std::numeric_limits<DstType>::max)());
};
};

Expand Down
2 changes: 1 addition & 1 deletion includes/acl/core/ptr_offset.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ namespace acl

private:
// Value representing an invalid offset
static constexpr offset_type k_invalid_value = std::numeric_limits<offset_type>::max();
static constexpr offset_type k_invalid_value = (std::numeric_limits<offset_type>::max)();

// Actual offset value.
offset_type m_value;
Expand Down

0 comments on commit 7dd3dd8

Please sign in to comment.