[clang, opengl] fix opengl build on PGO build and clang-cl on windows (#3332)

- [backported] opengl: fix PGO build error
(pulled from 34332ab81326c3f2dfae2fd11ff5b18619fedb1e@pflyly/eden-nightly)

- [clang] chore: fix std::min on windows

Signed-off-by: lizzie lizzie@eden-emu.dev
Co-authored-by: DraVee <dravee@dravee.dev>
Co-authored-by: Escary <81011361+pflyly@users.noreply.github.com>
Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3332
Reviewed-by: DraVee <dravee@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: Lizzie <lizzie@eden-emu.dev>
Co-committed-by: Lizzie <lizzie@eden-emu.dev>
This commit is contained in:
Lizzie 2026-01-18 02:35:57 +01:00 committed by crueter
parent 833a38b443
commit 6ec6ca7c37
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
11 changed files with 23 additions and 17 deletions

View file

@ -111,7 +111,7 @@ Result INewsDataService::Read(Out<u64> out_size, s64 offset,
R_SUCCEED();
}
const size_t len = std::min(out_buffer.size(), opened_payload.size() - off);
const size_t len = (std::min)(out_buffer.size(), opened_payload.size() - off);
std::memcpy(out_buffer.data(), opened_payload.data() + off, len);
*out_size = len;
R_SUCCEED();

View file

@ -142,7 +142,7 @@ Result INewsDatabaseService::GetListV1(Out<s32> out_count,
const size_t start = static_cast<size_t>(std::max(0, offset));
const size_t max_records = out_buffer.size() / record_size;
const size_t available = start < list.size() ? list.size() - start : 0;
const size_t count = std::min(max_records, available);
const size_t count = (std::min)(max_records, available);
for (size_t i = 0; i < count; ++i) {
const auto& src = list[start + i];
@ -182,7 +182,7 @@ Result INewsDatabaseService::GetList(Out<s32> out_count,
const size_t start = static_cast<size_t>(std::max(0, offset));
const size_t max_records = out_buffer.size() / record_size;
const size_t available = start < list.size() ? list.size() - start : 0;
const size_t count = std::min(max_records, available);
const size_t count = (std::min)(max_records, available);
if (count > 0) {
std::memcpy(out_buffer.data(), list.data() + start, count * record_size);

View file

@ -53,7 +53,7 @@ void NewsStorage::Clear() {
void NewsStorage::CopyZ(std::span<char> dst, std::string_view src) {
std::memset(dst.data(), 0, dst.size());
std::memcpy(dst.data(), src.data(), std::min(dst.size() - 1, src.size()));
std::memcpy(dst.data(), src.data(), (std::min)(dst.size() - 1, src.size()));
}
std::string NewsStorage::MakeKey(std::string_view news_id, std::string_view user_id) {