I'm working on an existing c++ project with visual studio, and I found out that almost every function declaration gets a __cdecl
in front of the function name, like:void __cdecl functionName()
. Then I jump to the definition of __cdecl
, which locates in the winnt.h
file:
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
#define NTAPI __stdcall
#else
#define _cdecl
#define __cdecl
#define NTAPI
#endif
I've searched cdecl and got that it's the default calling convention for C and C++ programs, but code above tells me that __cdecl
extends to nothing. So why place a __cdecl
before function name as it's just nothing ? or did I misunderstand the code above?