__cdecl, __stdcall and __fastcall are all called the exact same way?

前端 未结 2 1823
清歌不尽
清歌不尽 2020-12-17 23:08

I am using Visual C++ 2010, and MASM as my x64-Assembler.
This is my C++ code:

// include directive
#include \"stdafx.h\"
// functions
extern \"C\" int         


        
相关标签:
2条回答
  • 2020-12-17 23:52

    As far as i know x64 only uses the __fastcall convention. __cdecl and stdcall will just be compiled as __fastcall.

    0 讨论(0)
  • 2020-12-17 23:54

    The problem is that you're compiling for x64 targets. From MSDN

    Given the expanded register set, x64 just uses the __fastcall calling convention and a RISC-based exception-handling model. The __fastcall model uses registers for the first four arguments and the stack frame to pass the other parameters.

    Switch over to compiling for x86 targets, and you should be able to see the various calling conventions in action.

    0 讨论(0)
提交回复
热议问题