diff --git a/asio_compatibility.hpp b/asio_compatibility.hpp index 1e6648d..a9abd7c 100644 --- a/asio_compatibility.hpp +++ b/asio_compatibility.hpp @@ -50,7 +50,7 @@ namespace SimpleWeb { void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair &host_port, handler_type &&handler) { resolver.async_resolve(host_port.first, host_port.second, std::forward(handler)); } - asio::executor_work_guard make_work_guard(io_context &context) { + inline asio::executor_work_guard make_work_guard(io_context &context) { return asio::make_work_guard(context); } #else @@ -76,7 +76,7 @@ namespace SimpleWeb { void async_resolve(asio::ip::tcp::resolver &resolver, const std::pair &host_port, handler_type &&handler) { resolver.async_resolve(asio::ip::tcp::resolver::query(host_port.first, host_port.second), std::forward(handler)); } - io_context::work make_work_guard(io_context &context) { + inline io_context::work make_work_guard(io_context &context) { return io_context::work(context); } #endif