D-Programming-Language/dmd — pull request #1751 by AndrejMitrovic (2013-03-16 00:53:10+00:00)
Title: Issue 9723 - Add -main switch to generate stub main() function.

http://d.puremagic.com/issues/show_bug.cgi?id=9723

It's implemented in a similar fashion to RDMD, except the error message will point to the user-defined main function rather than the generated one, and the diagnostic error is nicer.

Not tested on Posix, hopefully it goes green.