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

Consider replacing extern "stdcall" fn with extern "system" fn where appropriate #92

Closed
m-hilgendorf opened this issue Oct 10, 2019 · 4 comments

Comments

@m-hilgendorf
Copy link

On Win32 targets extern "system" is the same as extern "stdcall", whereas on MacOS/Linux targets it's the same as extern "C". The reason behind this change is that there are cross platform COM APIs in the wild (eg, VST3 plugins for audio apps) that use the native calling convention, not stdcall.

Another option: use a feature gate and default to stdcall, in case for some reason people want to use the COM paradigm with a different calling convention outside of Windows.

@rylev
Copy link
Contributor

rylev commented Oct 11, 2019

Thanks for reporting this. Currently, support for platforms other than Windows is outside the scope of this crate. The intercom crate might be a better fit for that use case at this point. That’s not to say we won’t ever support other platforms, we’re just currently trying to limit the scope to make getting the crate bootstrapped easier. We should make this more explicit in the readme.

@m-hilgendorf
Copy link
Author

That's understandable. There's a lot more needed to support cross platform stuff anyway, mostly reexporting what's used from winapi.

@rylev
Copy link
Contributor

rylev commented Oct 22, 2019

I'm going to close this now since this isn't currently on our roadmap, but if we end up supporting other platforms other than Windows, we will definitely make this change.

@rylev rylev closed this as completed Oct 22, 2019
@bdbai
Copy link

bdbai commented Aug 6, 2020

Compiling with target thumbv7a-uwp-windows-msvc (a.k.a ARM for Windows Store apps) failed because stdcall is not supported:

error[E0570]: The ABI `"stdcall"` is not supported for the current target
  --> C:\Users\bdbai\.cargo\registry\src\github.com-1ecc6299db9ec823\com-0.2.0\src\interfaces\iclass_factory.rs:12:1
   |
12 | #[com_interface("00000001-0000-0000-c000-000000000046")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0570]: The ABI `"stdcall"` is not supported for the current target
 --> C:\Users\bdbai\.cargo\registry\src\github.com-1ecc6299db9ec823\com-0.2.0\src\interfaces\iunknown.rs:8:1
  |
8 | #[com_interface("00000000-0000-0000-C000-000000000046")]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

Please consider reopening this issue because ARMv7 is still a supported platform on Windows.

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