-
Notifications
You must be signed in to change notification settings - Fork 122
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
Adjust PreserveSig emission #789
Adjust PreserveSig emission #789
Conversation
FWIW I feel PreserveSig should remain on standard C methods. Only the COM interface methods should lack preservesig because those are the ones we expect to be projected with a different signature. |
Hate to disagree but I've been applying transformations on methods and free functions alike and it would be a major step back not to. Developers love it. |
@kennykerr I'm very curious now. Are you saying that win32 methods like CreateFile don't return values anymore? Methods that return hresult, win32 error codes, lstatus, etc... will throw instead of return error codes? |
It's more nuanced than that. First of all, it's not about "throwing". Rust doesn't have exceptions. It's about permitting or preventing transformation of some kind. Whether it's a method or free function, it can have a signature that may benefit from some transformation. This doesn't mean that every function that lacks the As an example, |
That makes sense. In CsWin32 we can deal with it either way, so if it's useful to you as-is, that's fine by me. |
Fixes #559
Removes PreserveSig emission for all APIs by default. Adds PreserveSig emission for class methods explicitly marked with
[PreserveSig]
inemitter.settings.rsp
. (Interface methods were already covered previously.)Metadata diff is too large to be useful, as you can imagine.