Automatically detect whether the entry point is main or WinMain