ucdr/msg.h.em: static inline the (de-)serialization methods

to avoid multiple definitions when using them from different places.
This commit is contained in:
Beat Küng 2023-11-15 10:49:06 +01:00
parent 2f91102808
commit f513c40d62
1 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ static inline constexpr int ucdr_topic_size_@(topic)()
return @(struct_size);
}
bool ucdr_serialize_@(topic)(const void* data, ucdrBuffer& buf, int64_t time_offset = 0)
static inline bool ucdr_serialize_@(topic)(const void* data, ucdrBuffer& buf, int64_t time_offset = 0)
{
const @(uorb_struct)& topic = *static_cast<const @(uorb_struct)*>(data);
@{
@ -153,7 +153,7 @@ for field_type, field_name, field_size, padding in fields:
return true;
}
bool ucdr_deserialize_@(topic)(ucdrBuffer& buf, @(uorb_struct)& topic, int64_t time_offset = 0)
static inline bool ucdr_deserialize_@(topic)(ucdrBuffer& buf, @(uorb_struct)& topic, int64_t time_offset = 0)
{
@{
for field_type, field_name, field_size, padding in fields: