diff options
| author | lizzie <lizzie@eden-emu.dev> | 2025-09-09 20:47:49 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-09-09 20:47:49 +0200 |
| commit | 9d2681ecc9565681db623fb71799e76381998512 (patch) | |
| tree | 3133129860a1569a8be8e7e0c9c5985adbd992ca /src/common/host_memory.cpp | |
| parent | 428f136a754096e34c7bfec902684e2546a43ca4 (diff) | |
[cmake] enable clang-cl and WoA builds (#348)
Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64.
Compiling on clang is *dramatically* faster so this should be useful for CI.
Co-authored-by: crueter <crueter@eden-emu.dev>
Co-authored-by: crueter <crueter@crueter.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/common/host_memory.cpp')
| -rw-r--r-- | src/common/host_memory.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 15a198e216..1b7532b6b9 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -199,8 +199,8 @@ public: std::scoped_lock lock{placeholder_mutex}; auto [it, end] = placeholders.equal_range({virtual_offset, virtual_end}); while (it != end) { - const size_t offset = std::max(it->lower(), virtual_offset); - const size_t protect_length = std::min(it->upper(), virtual_end) - offset; + const size_t offset = (std::max)(it->lower(), virtual_offset); + const size_t protect_length = (std::min)(it->upper(), virtual_end) - offset; DWORD old_flags{}; if (!VirtualProtect(virtual_base + offset, protect_length, new_flags, &old_flags)) { LOG_CRITICAL(HW_Memory, "Failed to change virtual memory protect rules"); @@ -266,8 +266,8 @@ private: } const size_t placeholder_begin = it->lower(); const size_t placeholder_end = it->upper(); - const size_t unmap_begin = std::max(virtual_offset, placeholder_begin); - const size_t unmap_end = std::min(virtual_offset + length, placeholder_end); + const size_t unmap_begin = (std::max)(virtual_offset, placeholder_begin); + const size_t unmap_end = (std::min)(virtual_offset + length, placeholder_end); ASSERT(unmap_begin >= placeholder_begin && unmap_begin < placeholder_end); ASSERT(unmap_end <= placeholder_end && unmap_end > placeholder_begin); @@ -655,8 +655,8 @@ private: *virtual_offset = 0; *length = 0; } else { - *virtual_offset = std::max(intended_start, address_space_start); - *length = std::min(intended_end, address_space_end) - *virtual_offset; + *virtual_offset = (std::max)(intended_start, address_space_start); + *length = (std::min)(intended_end, address_space_end) - *virtual_offset; } } |
