What is the point of defining a calling convention?

后端 未结 5 1552
醉话见心
醉话见心 2021-01-24 06:20

For example:

int WINAPI WinMain ( HINSTANCE instance, HINSTANCE prev_instance, PSTR cmd_line, int cmd_show )

WINAPI is a a define that looks li

5条回答
  •  半阙折子戏
    2021-01-24 07:10

    Because WINAPI is a macro (well a #define anyway) it can be "pre-processed" to mean something else or even nothing at all.

    That means you can write more portable code, as you can put in WINAPI when it is required by Win32 to mean __stdcall but, or if it is required in another environment to mean something else or nothing.

提交回复
热议问题