munt / munt

A multi-platform software synthesiser emulating pre-GM MIDI devices such as the Roland MT-32, CM-32L, CM-64 and LAPC-I. In no way endorsed by or affiliated with Roland Corp.

Home Page:http://munt.sourceforge.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C interfaces missing explicit calling convention decorations

aaronsgiles opened this issue · comments

When building for x86, there are several calling conventions (__cdecl, __stdcall, __fastcall). The options passed to the compiler when creating the mt32emu DLL appear to default to using the __cdecl convention. This is fine for building the DLL.

However, consumers of the DLL might be compiled with different calling conventions, and so it would be better if all the functions in c_interface.h and all the function pointers in c_types.h were explicitly decorated with __cdecl.

For example, I am working on a project that uses __fastcall by default. In order to properly load and call into the DLL, I had to modify c_types.h to explicitly add __cdecl to all the function pointers defined in the interfaces.

(This is for MSVC specifically, but in general on x86 it is best for DLLs to be explicit about the calling convention.)

Thanks for the quick official fix! 👍