包括参数的传递顺序和方式,谁负责释放参数的栈。
C++还有“名字粉碎”
__cdecl Specifics
For C, the __cdecl naming convention uses the function name preceded by an underscore ( _ );
no case translation is performed. Unless declared as extern "C", C++ functions use a different name-decorating scheme. For more information on decorated names, see Decorated Names.
__fastcall Specifics
Some of a __fastcall function’s arguments are passed in registers x86 Specific —> ECX and EDX END x86 Specific, and the rest are pushed onto the stack from right to left. The called routine pops these arguments from the stack before it returns. Typically, /Gr decreases execution time.
Important Be careful when using the __fastcall calling convention for any function written in inline assembly language. Your use of registers could conflict with the compiler’s use.
For C, the __fastcall naming convention uses the function name preceded by an at sign (@) followed by the size of the function’s arguments in bytes. No case translation isdo
ne. The compiler uses the following template for the naming convention:
@function_name@number
Note Microsoftdo
es not guarantee the same implementation of the __fastcall calling convention between compiler releases. For example, the implementation differs between the 16-bit and 32-bit compilers.
When using the __fastcall naming convention, use the standard include files. Otherwise, you will get unresolved external references.
__stdcall Specifics
A __stdcall function’s arguments are pushed onto the stack from right to left, and the called function pops these arguments from the stack before it returns.
For C, the __stdcall naming convention uses the function name preceded by an underscore ( _ ) and followed by an at sign (@) and the size of the function’s arguments in bytes. No case translation is performed. The compiler uses the following template for the naming convention:
_functionname@number
x86 Specific —>This option has no effect on the name decoration of C++ methods and functions. Unless declared as extern "C", C++ methods and functions use a different name-decorating scheme. For more information on decorated names, see Decorated Names. END x86 Specific