From 237856f7f114ad24cafd8918382c7886dd764b96 Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 13 Nov 2017 08:11:06 +0100 Subject: [PATCH] more fixes of unwanted macro expansions of min/max in headers (windows.h compatibility) --- include/libtorrent/announce_entry.hpp | 4 ++-- include/libtorrent/aux_/cppint_import_export.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libtorrent/announce_entry.hpp b/include/libtorrent/announce_entry.hpp index ced1d0b19..7c9b6b038 100644 --- a/include/libtorrent/announce_entry.hpp +++ b/include/libtorrent/announce_entry.hpp @@ -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 diff --git a/include/libtorrent/aux_/cppint_import_export.hpp b/include/libtorrent/aux_/cppint_import_export.hpp index b19367736..b75b1b24e 100644 --- a/include/libtorrent/aux_/cppint_import_export.hpp +++ b/include/libtorrent/aux_/cppint_import_export.hpp @@ -135,7 +135,7 @@ namespace boost { cpp_int_backend& 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; }