Use int on C# side and int32_t on the c side instead of bool for the library code to make this as explicit as it gets and avoid bool entirely.
Use bool on C# side and int32_t on the c side in the messages code. This avoids having to ad special cases to the C# template for the code generation. As bools in C# pInvokes get marshalled as 32 bit integer by default there is no need to change the code for bool fields.
extracted from https://github.com/ros2-dotnet/ros2_dotnet/pull/94
This fixes Issues with bools that where interpreted wrong in release builds and therefore causing wrong behavior.
See https://www.mono-project.com/docs/advanced/pinvoke/#boolean-membersfor more information on marshalling bools.
Took the following path:
int
on C# side andint32_t
on the c side instead of bool for the library code to make this as explicit as it gets and avoidbool
entirely.bool
on C# side andint32_t
on the c side in the messages code. This avoids having to ad special cases to the C# template for the code generation. Asbool
s in C# pInvokes get marshalled as 32 bit integer by default there is no need to change the code forbool
fields.