diff --git a/include/indicators/block_progress_bar.hpp b/include/indicators/block_progress_bar.hpp index d5c87cd..1c26992 100644 --- a/include/indicators/block_progress_bar.hpp +++ b/include/indicators/block_progress_bar.hpp @@ -122,7 +122,7 @@ class BlockProgressBar { size_t current() { std::lock_guard lock{mutex_}; - return std::min(static_cast(progress_), + return (std::min)(static_cast(progress_), size_t(get_value())); } @@ -179,7 +179,7 @@ class BlockProgressBar { auto elapsed = std::chrono::duration_cast(now - start_time_point_); if (get_value()) { - os << " " << std::min(static_cast(progress_ / max_progress * 100.0), size_t(100)) + os << " " << (std::min)(static_cast(progress_ / max_progress * 100.0), size_t(100)) << "%"; } diff --git a/include/indicators/details/stream_helper.hpp b/include/indicators/details/stream_helper.hpp index c7b4977..48d06b8 100644 --- a/include/indicators/details/stream_helper.hpp +++ b/include/indicators/details/stream_helper.hpp @@ -110,7 +110,7 @@ class BlockProgressScaleWriter { std::ostream &write(float progress) { std::string fill_text{"█"}; std::vector lead_characters{" ", "▏", "▎", "▍", "▌", "▋", "▊", "▉"}; - auto value = std::min(1.0f, std::max(0.0f, progress / 100.0f)); + auto value = (std::min)(1.0f, (std::max)(0.0f, progress / 100.0f)); auto whole_width = std::floor(value * bar_width); auto remainder_width = fmod((value * bar_width), 1.0f); auto part_width = std::floor(remainder_width * lead_characters.size()); diff --git a/include/indicators/progress_bar.hpp b/include/indicators/progress_bar.hpp index 63e6e15..2d547da 100644 --- a/include/indicators/progress_bar.hpp +++ b/include/indicators/progress_bar.hpp @@ -166,7 +166,7 @@ class ProgressBar { size_t current() { std::lock_guard lock{mutex_}; - return std::min( + return (std::min)( progress_, size_t(get_value())); } @@ -231,7 +231,7 @@ class ProgressBar { if (get_value()) { os << " " - << std::min(static_cast(static_cast(progress_) / + << (std::min)(static_cast(static_cast(progress_) / max_progress * 100), size_t(100)) << "%"; diff --git a/include/indicators/progress_spinner.hpp b/include/indicators/progress_spinner.hpp index 51e92b2..62d5b14 100644 --- a/include/indicators/progress_spinner.hpp +++ b/include/indicators/progress_spinner.hpp @@ -123,7 +123,7 @@ class ProgressSpinner { size_t current() { std::lock_guard lock{mutex_}; - return std::min(progress_, size_t(get_value())); + return (std::min)(progress_, size_t(get_value())); } bool is_completed() const { return get_value(); } diff --git a/single_include/indicators/indicators.hpp b/single_include/indicators/indicators.hpp index 2ae3b8d..46a0f05 100644 --- a/single_include/indicators/indicators.hpp +++ b/single_include/indicators/indicators.hpp @@ -2900,7 +2900,7 @@ class BlockProgressScaleWriter { std::ostream &write(float progress) { std::string fill_text{"█"}; std::vector lead_characters{" ", "▏", "▎", "▍", "▌", "▋", "▊", "▉"}; - auto value = std::min(1.0f, std::max(0.0f, progress / 100.0f)); + auto value = (std::min)(1.0f, (std::max)(0.0f, progress / 100.0f)); auto whole_width = std::floor(value * bar_width); auto remainder_width = fmod((value * bar_width), 1.0f); auto part_width = std::floor(remainder_width * lead_characters.size()); @@ -3128,7 +3128,7 @@ class BlockProgressScaleWriter { std::ostream &write(float progress) { std::string fill_text{"█"}; std::vector lead_characters{" ", "▏", "▎", "▍", "▌", "▋", "▊", "▉"}; - auto value = std::min(1.0f, std::max(0.0f, progress / 100.0f)); + auto value = (std::min)(1.0f, (std::max)(0.0f, progress / 100.0f)); auto whole_width = std::floor(value * bar_width); auto remainder_width = fmod((value * bar_width), 1.0f); auto part_width = std::floor(remainder_width * lead_characters.size()); @@ -3445,7 +3445,7 @@ class ProgressBar { size_t current() { std::lock_guard lock{mutex_}; - return std::min( + return (std::min)( progress_, size_t(get_value())); } @@ -3510,7 +3510,7 @@ class ProgressBar { if (get_value()) { os << " " - << std::min(static_cast(static_cast(progress_) / + << (std::min)(static_cast(static_cast(progress_) / max_progress * 100), size_t(100)) << "%"; @@ -3762,7 +3762,7 @@ class BlockProgressBar { size_t current() { std::lock_guard lock{mutex_}; - return std::min(static_cast(progress_), + return (std::min)(static_cast(progress_), size_t(get_value())); } @@ -3819,7 +3819,7 @@ class BlockProgressBar { auto elapsed = std::chrono::duration_cast(now - start_time_point_); if (get_value()) { - os << " " << std::min(static_cast(progress_ / max_progress * 100.0), size_t(100)) + os << " " << (std::min)(static_cast(progress_ / max_progress * 100.0), size_t(100)) << "%"; } @@ -4544,7 +4544,7 @@ class ProgressSpinner { size_t current() { std::lock_guard lock{mutex_}; - return std::min(progress_, size_t(get_value())); + return (std::min)(progress_, size_t(get_value())); } bool is_completed() const { return get_value(); }