From 2c8f93fb44cd08a6210f2b06d62ffb98677e7968 Mon Sep 17 00:00:00 2001 From: Vernon Mauery Date: Wed, 5 Sep 2018 12:02:39 -0700 Subject: sdbusplus::asio: fix callback with void args specialization Callbacks with no arguments failed to build due to an error in the utility::get_first_arg template. It failed to provide a type member for the void specialization. With this fix, it is possible to have a handler that has no arguments. Tested by: Added a new callback to the asio-example.cpp. Without the template change, this caused the build to fail as expected. After adding the template change, the build succeeds and the example runs as expected. Change-Id: Ib09b58c76df8cba57dc093ab37a4c1b68ea11ad3 Signed-off-by: Vernon Mauery --- example/asio-example.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'example/asio-example.cpp') diff --git a/example/asio-example.cpp b/example/asio-example.cpp index 31b55f2..354c7b0 100644 --- a/example/asio-example.cpp +++ b/example/asio-example.cpp @@ -17,6 +17,11 @@ int methodWithMessage(sdbusplus::message::message& m, int test) return ++test; } +int voidBar(void) +{ + return 42; +} + int main() { using GetSubTreeType = std::vectorregister_method("TestMethodWithMessage", methodWithMessage); + iface->register_method("VoidFunctionReturnsInt", voidBar); + iface->initialize(); iface->set_property("int", 45); io.run(); -- cgit v1.2.3