[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>
This commit is contained in:
lizzie 2025-09-09 20:47:49 +02:00 committed by crueter
parent 428f136a75
commit 9d2681ecc9
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
276 changed files with 973 additions and 1010 deletions

View file

@ -138,12 +138,12 @@ constexpr inline std::chrono::nanoseconds ConvertToTimeSpan(s64 ticks) {
std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::seconds(1)).count()};
constexpr s64 max{Common::WallClock::CNTFRQ *
(std::numeric_limits<s64>::max() / one_second_ns)};
((std::numeric_limits<s64>::max)() / one_second_ns)};
if (ticks > max) {
return std::chrono::nanoseconds(std::numeric_limits<s64>::max());
return std::chrono::nanoseconds((std::numeric_limits<s64>::max)());
} else if (ticks < -max) {
return std::chrono::nanoseconds(std::numeric_limits<s64>::min());
return std::chrono::nanoseconds((std::numeric_limits<s64>::min)());
}
auto a{ticks / Common::WallClock::CNTFRQ * one_second_ns};
@ -156,9 +156,9 @@ constexpr inline Result GetSpanBetweenTimePoints(s64* out_seconds, const SteadyC
const SteadyClockTimePoint& b) {
R_UNLESS(out_seconds, ResultInvalidArgument);
R_UNLESS(a.IdMatches(b), ResultInvalidArgument);
R_UNLESS(a.time_point >= 0 || b.time_point <= a.time_point + std::numeric_limits<s64>::max(),
R_UNLESS(a.time_point >= 0 || b.time_point <= a.time_point + (std::numeric_limits<s64>::max)(),
ResultOverflow);
R_UNLESS(a.time_point < 0 || b.time_point >= a.time_point + std::numeric_limits<s64>::min(),
R_UNLESS(a.time_point < 0 || b.time_point >= a.time_point + (std::numeric_limits<s64>::min)(),
ResultOverflow);
*out_seconds = b.time_point - a.time_point;

View file

@ -17,7 +17,7 @@ PowerStateRequestManager::~PowerStateRequestManager() {
void PowerStateRequestManager::UpdatePendingPowerStateRequestPriority(u32 priority) {
std::scoped_lock l{m_mutex};
if (m_has_pending_request) {
m_pending_request_priority = std::max(m_pending_request_priority, priority);
m_pending_request_priority = (std::max)(m_pending_request_priority, priority);
} else {
m_pending_request_priority = priority;
m_has_pending_request = true;