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

Add option for generating bindings using marshaling #74

Open
lithiumtoast opened this issue Apr 1, 2022 · 3 comments
Open

Add option for generating bindings using marshaling #74

lithiumtoast opened this issue Apr 1, 2022 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@lithiumtoast
Copy link
Member

lithiumtoast commented Apr 1, 2022

Use MarshalAs attribute for strings, arrays, etc. Don't use CString in this case in bindgen.

See Microsoft docs for an example tutorial: https://learn.microsoft.com/en-us/dotnet/standard/native-interop/tutorial-custom-marshaller?source=recommendations.

@lithiumtoast lithiumtoast added the enhancement New feature or request label Apr 1, 2022
@lithiumtoast lithiumtoast added the help wanted Extra attention is needed label Apr 24, 2022
@shayded-exe
Copy link

It would be awesome to support the new C# 11 UTF-8 strings!

@lithiumtoast
Copy link
Member Author

lithiumtoast commented Jan 3, 2025

@shayded-exe UTF-8 strings has been done in #167

@lithiumtoast
Copy link
Member Author

I believe at this time adding an option to generate bindings using specific marshalling or custom marshalling is not aligned to the goals of this project and thus won't be implemented by me directly. I am happy to leave this issue open and have other people submit a pull request if they want to.

Microsoft has some documentation on custom marshalling here https://learn.microsoft.com/en-us/dotnet/standard/native-interop/tutorial-custom-marshaller?source=recommendations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants