6 ms·
they are com classes. the vtable layout for them is specified.
by Zoadian 11mo ago
they are com classes. the vtable layout for them is specified.
- debugnik 11mo agoNot really, VST3's COM-like API just uses virtual methods, they don't guarantee layout to the same degree actual COM does with compiler support. They simply rely on the platform ABI being standardized enough.
- codedokode 11mo agoI don't think GCC has a special case for handling COM classes. However, I found that GCC uses "Itanium CXX ABI" on Linux which specifies vtable layout which accidentally might match the layout of COM classes. However, it is not guaranteered (for example, by C++ standards) that other compilers use the same layout.
- duped 11mo agoThe ABI is stable everywhere VST3s are used. It has to be or nothing would work.
- codedokode 11mo agoEverything would work except for VST3, if written according to standards.
- duped 11mo agoThe ABI isn't covered by C++ standards, it's target and architecture dependent. For the purposes of this discussion that ABI is stable for C++ vtables on the targets and architectures that VST3 supports. If a compiler and linker don't follow those ABIs then it would also be close to useless for compiling or linking against shared libraries. So in the wild, all useful compilers do target the same ABIs. gcc in mingw on windows is the odd duck, but most production software does not support it anyway.
- codedokode 11mo ago> If a compiler and linker don't follow those ABIs then it would also be close to useless for compiling or linking against shared libraries. I guess in C++ you are not supposed to link libraries produced by different compilers? Maybe you should use C-compatible interfaces in this case?
- duped 11mo agoYou are, you can, and people do. Sure you should use C interfaces, that's what CLAP does, and it's easier to understand as a result. The C standard similarly does not specify an ABI.