On 2014-01-08 14:28, Adam D. Ruppe wrote:

eh they're really in the same boat. Declaring your own WinMain is kinda
like declaring your own _start symbol on linux. It skips the runtime's
main() function and you're more on your own.

No, it's not.

For C:

Implementing WinMain does not bypass the runtime[1]. Implementing _start on Linux would most likely bypass the runtime. Implementing WinMain is more like implementing main() on Posix.

For D:

Implementing WinMain or main() as extern (C) will bypass the D runtime, it still won't bypass the C runtime.

I would expect the boot process be something like this:

Linux:
_start
C main
D main

Windows:
CRT (C runtime library)
C main or WinMain
D main

Both the C and the D runtimes implement their own entry point which
calls into your program's main and you can use these consistently across
platforms.

WinMain is not the entry point. The C runtime library will call it just like it will call C main.

[1] http://msdn.microsoft.com/en-us/library/windows/desktop/ff381406%28v=vs.85%29.aspx

--
/Jacob Carlborg

Reply via email to