mirror of
https://github.com/Kistler-Group/sdbus-cpp.git
synced 2025-07-30 01:57:15 +02:00
fix: make REGISTER_STRUCT functions inline
This makes that you can use these macros in headers as well as source files. Else you will get a warning about multiple definitions of the same function.
This commit is contained in:
committed by
Stanislav Angelovič
parent
3d3aa26255
commit
50cc636058
@ -437,11 +437,11 @@ struct std::tuple_size<sdbus::Struct<_ValueTypes...>>
|
||||
namespace sdbus { \
|
||||
static_assert(SDBUSCPP_PP_NARG(__VA_ARGS__) <= 16, \
|
||||
"Not more than 16 struct members are supported, please open an issue if you need more"); \
|
||||
sdbus::Message& operator<<(sdbus::Message& msg, const STRUCT& items) \
|
||||
inline sdbus::Message& operator<<(sdbus::Message& msg, const STRUCT& items) \
|
||||
{ \
|
||||
return msg << sdbus::Struct{std::forward_as_tuple(SDBUSCPP_STRUCT_MEMBERS(items, __VA_ARGS__))}; \
|
||||
} \
|
||||
sdbus::Message& operator>>(sdbus::Message& msg, STRUCT& items) \
|
||||
inline sdbus::Message& operator>>(sdbus::Message& msg, STRUCT& items) \
|
||||
{ \
|
||||
sdbus::Struct s{std::forward_as_tuple(SDBUSCPP_STRUCT_MEMBERS(items, __VA_ARGS__))}; \
|
||||
return msg >> s; \
|
||||
|
Reference in New Issue
Block a user