|
||
The __cdecl calling convention |
||||||||||||||
The __cdecl calling convention is used for the SilverCExec function, and also for SilverC library functions, which are called via pointers passed to the DLL. The calling function cleans up the stack Functions that use this calling convention require a function prototype. The following list shows the implementation of this calling convention.
|
||||||||||||||
|
||||||||||||||
Notes |
The Visual C '/Gd' compiler options specifies __cdecl for all functions not explicitly declared with a different calling convention.
Note that although for __cdecl functions the C compiler generates a symbol that is prefixed with ‘_’, the linker, when exporting such a symbol from the DLL, strips the ‘_’ from the exported name.
You may use a function with a name other name than DllMain by using the /ENTRY: linker option; to keep things simple, we retain the DllMain convention.
SilverScreen is built using the _AFXDLL architecture, that is, it uses the MFC and C runtime DLL's, rather than statically linking them. The SilverC extension DLL may also use the MFC as well in a DLL, thus saving code. Beware... the standard run-time library calls in a SilverC extension library are actually implemented via call through a function pointer in the SSREX structure passed at initialization time.
|