diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-09-17 08:16:18 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-09-17 08:16:18 +0200 |
| commit | 1203082a8f1211ad6ce4d95f0c6947f7ecd27a55 (patch) | |
| tree | 47fbda810dc0d75ed960a1f609f7a1a7bf0c18f1 | |
| parent | 14235dc0d0543c7397dd19eb1a677e76114c08f3 (diff) | |
[msvc] fix build errors (#4451)
MSVC doesn't consider atomic<u64> to be trivially copyable on x86 (why?).
And other chary idiosyncrasies from constructing `std::optional<uint8_t>`
Signed-off-by: lizzie <lizzie@eden-emu.dev>
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
-------------------
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4451
Reviewed-by: Maufeat <sahyno1996@gmail.com>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
| -rw-r--r-- | src/common/sparse_large_vector.h | 3 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.cpp | 4 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/ssl/ssl.cpp | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/src/common/sparse_large_vector.h b/src/common/sparse_large_vector.h index 827944fb08..dad3aea97e 100644 --- a/src/common/sparse_large_vector.h +++ b/src/common/sparse_large_vector.h @@ -38,7 +38,8 @@ void FreeMemoryPages(void* base, std::size_t size) noexcept; /// A large page-aligned buffer that has optimized memory usage for zero-writes. template <typename T> -requires std::is_trivially_copyable_v<T> + // MSVC doesn't regard structs with atomics as trivially copyable + // requires std::is_trivially_copyable_v<T> class SparseLargeVector final { public: constexpr SparseLargeVector() = default; diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 80e2b2dca9..8be0abc4fa 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp @@ -177,7 +177,7 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) { config.page_table = reinterpret_cast<std::array<std::uint8_t*, NumPageTableEntries>*>( const_cast<Common::PageTable::PageEntryData*>(page_table->entries.data())); config.page_table_pointer_mask = Common::PageTable::ATTRIBUTE_MASK; - config.page_table_marked_bit = 0; + config.page_table_marked_bit = uint8_t(0); config.absolute_offset_page_table = true; config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; config.only_detect_misalignment_via_page_table_on_page_boundary = true; @@ -193,7 +193,7 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) { Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize()) < (1ULL << 39)) { // Systems like FreeBSD allocate memory really low by default, and since we pack our page table entries, // we have to manually sign extend when our actual pointer is negative. - config.page_table_sign_extension = Common::PageTable::SIGN_BIT; + config.page_table_sign_extension = std::uint8_t(Common::PageTable::SIGN_BIT); } } diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 9662bf1712..9db40b9356 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp @@ -216,7 +216,7 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s const_cast<Common::PageTable::PageEntryData*>(page_table->entries.data())); config.page_table_address_space_bits = std::uint32_t(address_space_bits); config.page_table_pointer_mask = Common::PageTable::ATTRIBUTE_MASK; - config.page_table_marked_bit = 0; + config.page_table_marked_bit = uint8_t(0); config.silently_mirror_page_table = false; config.absolute_offset_page_table = true; config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; @@ -235,7 +235,7 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s Kernel::Board::Nintendo::Nx::KSystemControl::Init::GetIntendedMemorySize()) < (1ULL << 39)) { // Systems like FreeBSD allocate memory really low by default, and since we pack our page table entries, // we have to manually sign extend when our actual pointer is negative. - config.page_table_sign_extension = Common::PageTable::SIGN_BIT; + config.page_table_sign_extension = std::uint8_t(Common::PageTable::SIGN_BIT); } } diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 178c4c690b..999efd4295 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -238,7 +238,7 @@ private: Result GetSocketDescriptor(Out<u32> out_fd) { LOG_WARNING(Service_SSL, "(STUBBED)"); - *out_fd = socket->GetFD(); + *out_fd = uint32_t(socket->GetFD()); R_SUCCEED(); } |
