core: Temporary workaround for MSVC compiler bug (#1505)

This commit is contained in:
PabloMK7 2025-12-07 22:27:50 +01:00 committed by GitHub
parent 9996a07e87
commit b0fe4d190d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -178,7 +178,7 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(u32* cmd_buf, const Funct
void ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& context) {
auto itr = handlers.find(context.CommandHeader().command_id.Value());
const FunctionInfoBase* info = itr == handlers.end() ? nullptr : &itr->second;
if (info == nullptr || info->handler_callback == nullptr) {
if (info == nullptr || !info->implemented) {
context.ReportUnimplemented();
return ReportUnimplementedFunction(context.CommandBuffer(), info);
}

View File

@ -82,6 +82,7 @@ private:
struct FunctionInfoBase {
u32 command_id;
bool implemented;
HandlerFnP<ServiceFrameworkBase> handler_callback;
const char* name;
};
@ -96,6 +97,8 @@ private:
void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n);
void ReportUnimplementedFunction(u32* cmd_buf, const FunctionInfoBase* info);
void Empty(Kernel::HLERequestContext& ctx) {}
/// Identifier string used to connect to the service.
std::string service_name;
/// Maximum number of concurrent sessions that this service can handle.
@ -134,9 +137,11 @@ protected:
*/
constexpr FunctionInfo(u32 command_id, HandlerFnP<Self> handler_callback, const char* name)
: FunctionInfoBase{
command_id,
command_id, handler_callback != nullptr,
// Type-erase member function pointer by casting it down to the base class.
static_cast<HandlerFnP<ServiceFrameworkBase>>(handler_callback), name} {}
handler_callback ? static_cast<HandlerFnP<ServiceFrameworkBase>>(handler_callback)
: &ServiceFrameworkBase::Empty,
name} {}
};
/**