[common] replace Common::BitCast with libc++ provided one (#2774)

Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2774
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: crueter <crueter@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 2025-10-22 02:56:28 +02:00 committed by crueter
parent 6ff043c4fb
commit 992bae4e2a
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
25 changed files with 152 additions and 151 deletions

View file

@ -1,8 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2023 merryhime <https://mary.rs>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/bit_cast.h"
#include <numeric>
#include "core/arm/nce/interpreter_visitor.h"
namespace Core {

View file

@ -1,8 +1,9 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <numeric>
#include <bit>
#include "common/arm64/native_clock.h"
#include "common/bit_cast.h"
#include "common/literals.h"
#include "core/arm/nce/arm_nce.h"
#include "core/arm/nce/guest_context.h"
@ -435,7 +436,7 @@ void Patcher::WriteMsrHandler(ModuleDestLabel module_dest, oaknut::XReg src_reg)
void Patcher::WriteCntpctHandler(ModuleDestLabel module_dest, oaknut::XReg dest_reg) {
static Common::Arm64::NativeClock clock{};
const auto factor = clock.GetGuestCNTFRQFactor();
const auto raw_factor = Common::BitCast<std::array<u64, 2>>(factor);
const auto raw_factor = std::bit_cast<std::array<u64, 2>>(factor);
const auto use_x2_x3 = dest_reg.index() == 0 || dest_reg.index() == 1;
oaknut::XReg scratch0 = use_x2_x3 ? X2 : X0;

View file

@ -5,11 +5,12 @@
#include <fstream>
#include <sstream>
#include <vector>
#include <numeric>
#include <ranges>
#include <bit>
#include "common/bit_cast.h"
#include "common/common_types.h"
#include "common/logging/log.h"
#include <ranges>
#include "common/settings.h"
#include "common/string_util.h"
#include "core/internal_network/emu_net_state.h"
@ -123,8 +124,8 @@ std::vector<Network::NetworkInterface> GetAvailableNetworkInterfaces() {
// Just use 0 as the gateway address
result.emplace_back(Network::NetworkInterface{
.name{ifa->ifa_name},
.ip_address{Common::BitCast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr},
.subnet_mask{Common::BitCast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr},
.ip_address{std::bit_cast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr},
.subnet_mask{std::bit_cast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr},
.gateway{in_addr{.s_addr = 0}}
});
#else
@ -139,8 +140,8 @@ std::vector<Network::NetworkInterface> GetAvailableNetworkInterfaces() {
gateway_0.s_addr = gateway;
result.emplace_back(Network::NetworkInterface{
.name = ifa->ifa_name,
.ip_address = Common::BitCast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr,
.subnet_mask = Common::BitCast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr,
.ip_address = std::bit_cast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr,
.subnet_mask = std::bit_cast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr,
.gateway = gateway_0
});
continue;
@ -191,8 +192,8 @@ std::vector<Network::NetworkInterface> GetAvailableNetworkInterfaces() {
gateway_0.s_addr = gateway;
result.emplace_back(Network::NetworkInterface{
.name = ifa->ifa_name,
.ip_address = Common::BitCast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr,
.subnet_mask = Common::BitCast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr,
.ip_address = std::bit_cast<struct sockaddr_in>(*ifa->ifa_addr).sin_addr,
.subnet_mask = std::bit_cast<struct sockaddr_in>(*ifa->ifa_netmask).sin_addr,
.gateway = gateway_0
});
#endif // ANDROID