Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default calling convention of static member functions in visual studio?

What is the default calling convention of static member functions for Microsoft's compiler? Can I change it by placing WINAPI in front of it?

like image 537
angela d Avatar asked Sep 01 '11 19:09

angela d


2 Answers

The default convention is what ever is set in the project options (C/C++ -> Advanced -> Calling Convention), this defaults to __cdecl (command line option /Gd)

like image 68
Necrolis Avatar answered Sep 22 '22 19:09

Necrolis


The default calling convention is cdecl. Yes, you can override this and specify the calling convention. In this regard there is nothing special about static member functions.

like image 40
David Heffernan Avatar answered Sep 23 '22 19:09

David Heffernan