Fix serialization on non-32-bit, big-endian systems (#159)
This commit is contained in:
parent
073d21ab8f
commit
5616437a4d
1 changed files with 2 additions and 1 deletions
|
@ -299,8 +299,9 @@ protected:
|
|||
void serialize_u32(CDRCursor * cursor, size_t value) const
|
||||
{
|
||||
assert(value <= std::numeric_limits<uint32_t>::max());
|
||||
auto u32_value = static_cast<uint32_t>(value);
|
||||
cursor->align(4);
|
||||
cursor->put_bytes(&value, 4);
|
||||
cursor->put_bytes(&u32_value, 4);
|
||||
}
|
||||
|
||||
static size_t get_cdr_size_of_primitive(ROSIDL_TypeKind tk)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue