(no title)
holy_city | 6 years ago
I'm really glad MS is doing this. What needs to be a bit clearer to me is how they maintain ABI compatibility under the hood of MSVC for COM interfaces (which uses the vtable layout of an inherited class) and how that's compatible with MinGW/GCC stacks on Windows, mostly what can break it. I got stuck porting VST3 with multiple inheritance, and it was a headache trying to reverse engineer the appropriate struct layouts for COM implementations.
[1] https://github.com/retep998/winapi-rs/blob/0.3/src/macros.rs
[2] https://github.com/Connicpu/com-impl
[3] https://github.com/steinbergmedia/vst3sdk
[4] https://github.com/m-hilgendorf/cli-host (sorry for the messy code, it was a weekend of hacking away trying to host a VST3 in pure Rust)
barrkel|6 years ago
The way MSVC does it may need reverse engineering (it may be patented btw). I could explain how Delphi implements COM interfaces, but any specific implementation is actually more complicated than the ABI, because they're trying to add implementation ergonomics on top of the basic calling convention.
holy_city|6 years ago
ChrisSD|6 years ago
This isn't quite right. The calling convention is a Windows C++ variant of stdcall. See this issue: https://github.com/rust-lang/rfcs/issues/1342
However, 99% of the time the difference won't be an issue.
pjmlp|6 years ago
holy_city|6 years ago
[1] https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vtable