more fixes of unwanted macro expansions of min/max in headers (windows.h compatibility)

This commit is contained in:
arvidn 2017-11-13 08:11:06 +01:00 committed by Arvid Norberg
parent 521587c026
commit 237856f7f1
2 changed files with 4 additions and 4 deletions

View File

@ -68,10 +68,10 @@ namespace libtorrent {
tcp::endpoint local_endpoint;
// the time of next tracker announce
time_point32 next_announce = time_point32::min();
time_point32 next_announce = (time_point32::min)();
// no announces before this time
time_point32 min_announce = time_point32::min();
time_point32 min_announce = (time_point32::min)();
private:
// internal

View File

@ -135,7 +135,7 @@ namespace boost {
cpp_int_backend<MinBits, MaxBits, SignType, Checked, Allocator>& result = val.backend();
result.resize(limb_len, limb_len); // checked types may throw here if they're not large enough to hold the data!
result.limbs()[result.size() - 1] = 0u;
std::memcpy(result.limbs(), i, std::min(byte_len, result.size() * sizeof(limb_type)));
std::memcpy(result.limbs(), i, (std::min)(byte_len, result.size() * sizeof(limb_type)));
result.normalize(); // In case data has leading zeros.
return val;
}
@ -151,7 +151,7 @@ namespace boost {
++limb_len;
result.limbs()[0] = 0u;
result.resize(limb_len, limb_len); // checked types may throw here if they're not large enough to hold the data!
std::memcpy(result.limbs(), i, std::min(byte_len, result.size() * sizeof(result.limbs()[0])));
std::memcpy(result.limbs(), i, (std::min)(byte_len, result.size() * sizeof(result.limbs()[0])));
result.normalize(); // In case data has leading zeros.
return val;
}