Fix marshalling bool parameters and return values in pInvokes #106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
extracted from #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.