Skip to content

Commit

Permalink
Refs #18687. Export serialize functions on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware committed Jul 24, 2023
1 parent d325359 commit e8907da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ $if (parent.IsInterface)$$parent.name$_$endif$$struct.name$PubSubType::$if (pare
{
$if (ctx.GenerateTypesROS2)$ setName("$struct.ROS2Scopedname$");$else$ setName("$struct.scopedname$");$endif$
uint32_t type_size = $struct.cScopedname$_max_cdr_typesize;
type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
m_typeSize = type_size + 4; /*encapsulation*/
m_isGetKeyDefined = $if(struct.hasKey)$true$else$false$endif$;
uint32_t keyLength = $struct.cScopedname$_max_key_cdr_typesize > 16 ? $struct.cScopedname$_max_key_cdr_typesize : 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ $exports; separator="\n"$
exception(ctx, parent, exception) ::= <<

$if(ctx.anyCdr)$
size_t calculate_serialized_size(
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const $exception.scopedname$& data,
size_t current_alignment);
$endif$

$if(ctx.cdr)$
void serialize(
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const $exception.scopedname$& data);

void deserialize(
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
$exception.scopedname$& data);
$endif$
Expand All @@ -99,22 +99,22 @@ typedef_decl(ctx, parent, typedefs) ::= <<>>

struct_type(ctx, parent, struct, extensions) ::= <<
$if(ctx.anyCdr)$
size_t calculate_serialized_size(
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const $struct.scopedname$& data,
size_t current_alignment);
$endif$

$if(ctx.cdr)$
void serialize(
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const $struct.scopedname$& data);

void deserialize(
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
$struct.scopedname$& data);

void serialize_key(
eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const $struct.scopedname$& data);

Expand All @@ -124,18 +124,18 @@ $endif$

bitset_type(ctx, parent, bitset) ::= <<
$if(ctx.anyCdr)$
size_t calculate_serialized_size(
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const $bitset.scopedname$& $if(bitset.parents)$data$endif$,
size_t current_alignment);
$endif$

$if(ctx.cdr)$
void serialize(
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const $bitset.scopedname$& data);

void deserialize(
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& dcdr,
$bitset.scopedname$& data);
$endif$
Expand All @@ -145,19 +145,19 @@ public_bitfield_definition(member) ::= <<>>

union_type(ctx, parent, union) ::= <<
$if(ctx.anyCdr)$
size_t calculate_serialized_size(
eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator,
const $union.scopedname$& data,
size_t current_alignment);

$endif$

$if(ctx.cdr)$
void serialize(
eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr,
const $union.scopedname$& data);

void deserialize(
eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr,
$union.scopedname$& data);
$endif$
Expand Down

0 comments on commit e8907da

Please sign in to comment.