Why is name management using the WinMain () function used?

Based on my understanding, the name mangling is used when overloading a function, so functions with the same name can be distinguished.

But I noticed that the name mangling is also used with a function WinMain()(which is not overloaded). After changing the name, he becomes _WinMain@16.

So why is the name mangling used with the function used WinMain()?


This is the code I used:

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{

    return 0;
}
+4
source share
1 answer

, . - ++ (, , ). " " win32 ABI. Windows , , .

@ stdcall, - . WINAPI , , stdcall .

ABI . . Linux cdecl . , ( @)

+7

Source: https://habr.com/ru/post/1680888/


All Articles