Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for disabled runtime marshalling #458

Closed
alexrp opened this issue Jun 22, 2023 · 2 comments
Closed

Support for disabled runtime marshalling #458

alexrp opened this issue Jun 22, 2023 · 2 comments

Comments

@alexrp
Copy link
Contributor

alexrp commented Jun 22, 2023

https://learn.microsoft.com/en-us/dotnet/standard/native-interop/disabled-marshalling

There was some discussion on this topic in #428; I figured I'd open this issue to track support for this feature.

The bool issue in particular is one that I'm running into with a library that I'm generating bindings for. I am using [assembly: DisableRuntimeMarshalling] so it's a bit unfortunate that the P/Invoke signatures end up using byte. (Perhaps also worth noting that remapping with --remap _Bool=bool and/or --remap bool=bool as a hacky workaround isn't possible.)

@kkukshtel
Copy link
Contributor

I ended up just doing a cast for the "bool" type at the calling location/handoff to managed code. I only ever touch the values once so it worked well enough for me.

@tannergooding
Copy link
Member

Resolved in #480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants