-
Notifications
You must be signed in to change notification settings - Fork 114
Description
After pulling my hair out trying to figure out why some plugins would initialize just fine when calling clap_entry->init()
in this new Wine CLAP plugin bridge I've been working on while others don't, I finally realized that CLAP doesn't specify any calling conventions. Which means that on 32-bit Windows calling any CLAP functions is currently undefined behavior. This is mostly relevant on 32-bit Windows as 64-bit Windows uses a single calling convention, but having explicit calling conventions is still useful as there already are 32-bit Windows CLAP hosts and plugins. Wine these calling conventions are also mandatory when working with Winelib applications like I was.
The fix for this would be to define something like a CLAP_ABI
macro that's set to __cdecl
on Windows and and that's empty on other platforms. All function pointers bool(*foo)(int bar)
in the CLAP API then need to be changed to bool(CLAP_ABI *foo)(int bar)
.
EDIT: Fixed some errors, I misremembered some things.