From 190291ec6c35268dba2717b574544872a671b1fa Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Thu, 24 Oct 2024 19:35:50 -0700 Subject: [PATCH] CachedInterpreterEmitter: Demote `consteval` Functions This compiles on MSVC... unless it doesn't. Can't figure out why, so better just change it for now. --- .../PowerPC/CachedInterpreter/CachedInterpreterEmitter.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreterEmitter.h b/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreterEmitter.h index 7b1554ffc1..8058bf4497 100644 --- a/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreterEmitter.h +++ b/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreterEmitter.h @@ -17,6 +17,9 @@ struct PowerPCState; class CachedInterpreterEmitter { + // Note: Turning the constexpr `CallbackCast` functions consteval causes error C7595 "call + // to immediate function is not a constant expression" on MSVC... and only for some people. + protected: // The return value of most callbacks is the distance in memory to the next callback. // If a callback returns 0, the block will be exited. The return value is signed to @@ -26,7 +29,7 @@ protected: using AnyCallback = s32 (*)(PowerPC::PowerPCState& ppc_state, const void* operands); template - static consteval Callback CallbackCast(Callback callback) + static constexpr Callback CallbackCast(Callback callback) { return callback; } @@ -35,7 +38,7 @@ protected: { return reinterpret_cast(callback); } - static consteval AnyCallback AnyCallbackCast(AnyCallback callback) { return callback; } + static constexpr AnyCallback AnyCallbackCast(AnyCallback callback) { return callback; } // Disassemble callbacks will always return the distance to the next callback. template @@ -47,7 +50,7 @@ protected: { return reinterpret_cast(disassemble); } - static consteval AnyDisassemble AnyDisassembleCast(AnyDisassemble disassemble) + static constexpr AnyDisassemble AnyDisassembleCast(AnyDisassemble disassemble) { return disassemble; }