Why can WinMain have two return types?
If I remove it,will report this warning:
warning C4007: 'WinMain' : must be '__stdcall'
Or I’m reading int WINAPI wrongly?
UPDATE
I tried these two variants which are said to be the same as WINAPI,none work:
int __declspec WinMain
int __declspec(stdcall) WinMain
WINAPIisn’t a return type it’s a macro expanding to an implementation specific decoration or attribute for the function. In this instance it specifies the calling convention and is equivalent to__stdcall.Grammatically, WINAPI is roughly (but not exactly) equivalent to a storage class specifier like
static.