Skip to content

Commit

Permalink
Fixed an error that occurred when building with c++20 specified in wi…
Browse files Browse the repository at this point in the history
…ndows (#972)
  • Loading branch information
rumichi2210 authored Nov 19, 2023
1 parent 953aea3 commit 7e5bbf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dev/Cpp/Effekseer/Effekseer/Utils/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdint.h>
#include <string>
#include <vector>
#include <iterator>

#include "Effekseer.CustomAllocator.h"

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -158,7 +159,7 @@ class FixedSizeString

FixedSizeString<T, N>& operator+=(const FixedSizeString<T, N>& c)
{
const auto new_size = std::min(this->size_ + c.size_, static_cast<size_t>(N));
const auto new_size = (std::min)(this->size_ + c.size_, static_cast<size_t>(N));
const auto copied_size = new_size - this->size_;

memcpy(data_.data() + size_, c.data_.data(), copied_size * sizeof(T));
Expand Down

0 comments on commit 7e5bbf2

Please sign in to comment.