From 7e5bbf23b58e9576a211e79eb844a4783a44e5fd Mon Sep 17 00:00:00 2001 From: rumichi <80189457+rumichi2210@users.noreply.github.com> Date: Sun, 19 Nov 2023 20:20:07 +0900 Subject: [PATCH] Fixed an error that occurred when building with c++20 specified in windows (#972) --- Dev/Cpp/Effekseer/Effekseer/Utils/String.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dev/Cpp/Effekseer/Effekseer/Utils/String.h b/Dev/Cpp/Effekseer/Effekseer/Utils/String.h index e8ea9642a5..bf7022fe4c 100644 --- a/Dev/Cpp/Effekseer/Effekseer/Utils/String.h +++ b/Dev/Cpp/Effekseer/Effekseer/Utils/String.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "Effekseer.CustomAllocator.h" @@ -107,7 +108,7 @@ class FixedSizeString FixedSizeString(const T* ptr) { size_t original_length = Traits::length(ptr); - size_ = std::min(data_.size() - 1, original_length); + size_ = (std::min)(data_.size() - 1, original_length); memcpy(data_.data(), ptr, size_ * sizeof(T)); data_[size_] = 0; } @@ -158,7 +159,7 @@ class FixedSizeString FixedSizeString& operator+=(const FixedSizeString& c) { - const auto new_size = std::min(this->size_ + c.size_, static_cast(N)); + const auto new_size = (std::min)(this->size_ + c.size_, static_cast(N)); const auto copied_size = new_size - this->size_; memcpy(data_.data() + size_, c.data_.data(), copied_size * sizeof(T));