From 63fc847f8ae43b173a9031071eebb76a1961c41c Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 25 Apr 2019 05:15:30 -0700 Subject: [PATCH] libstrat: Add MakeServiceCommandEx --- include/stratosphere/ipc/ipc_serialization.hpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/stratosphere/ipc/ipc_serialization.hpp b/include/stratosphere/ipc/ipc_serialization.hpp index 74086a7a..4c856b89 100644 --- a/include/stratosphere/ipc/ipc_serialization.hpp +++ b/include/stratosphere/ipc/ipc_serialization.hpp @@ -560,12 +560,11 @@ struct Encoder> { /* ================================================================================= */ -template +template> constexpr Result WrapIpcCommandImpl(IpcResponseContext *ctx) { using InArgs = typename PopFront>::type; using OutArgs = typename boost::callable_traits::return_type_t; - using ClassType = typename boost::callable_traits::class_of_t; - + static_assert(std::is_base_of_v, ClassType>, "Override class type incorrect"); using CommandMetaData = CommandMetaInfo; static_assert(CommandMetaData::ReturnsResult || CommandMetaData::ReturnsVoid, "IpcCommandImpls must return Result or void"); @@ -664,5 +663,16 @@ inline static constexpr ServiceCommandMeta MakeServiceCommandMeta() { }; }; +template +inline static constexpr ServiceCommandMeta MakeServiceCommandMetaEx() { + return { + .fw_low = l, + .fw_high = h, + .cmd_id = c, + .handler = WrapIpcCommandImpl, + }; +}; + + #pragma GCC diagnostic pop