How to change calling convention in C?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shubhangi24
    New Member
    • Oct 2012
    • 20

    How to change calling convention in C?

    As C supports _cdecl calling convention if I want to change it to _stdcall then what should I have to do?
  • donbock
    Recognized Expert Top Contributor
    • Mar 2008
    • 2427

    #2
    This is outside the C Standard, making it an implementation-defined feature. What is your compiler and target environment?

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      Just place the calling convention between the function name and the return type:

      Code:
      void _stdcall Myfunction( etc...);
      BTW: _stdcall is also known as WINAPI.

      Comment

      • Shubhangi24
        New Member
        • Oct 2012
        • 20

        #4
        Thank you weaknessforcats .....

        Comment

        Working...