From mboxrd@z Thu Jan 1 00:00:00 1970 From: ron@ronnatalie.com (Ronald Natalie) Date: Sun, 26 Feb 2012 08:28:36 -0500 Subject: [TUHS] why the leading under score added to function names? In-Reply-To: <4F495D84.8030206@fastmail.us> References: <201202221917.q1MJHSGw013561@freefriends.org> <20120223043021.GA72269@dereel.lemis.com> <4F492C43.3020602@fastmail.us> <20120225203959.GE29866@mercury.ccil.org> <4F495D84.8030206@fastmail.us> Message-ID: <29D22528-0E74-4465-BA18-BF3DDE1BB674@ronnatalie.com> On Feb 25, 2012, at 5:15 PM, Random832 wrote: >> > > This is not true in my experience. If it was ever true, it's not true > today (with MSVC, anyway. GCC may be different, but if there is a > 'system-provided main()' it's GCC, or cygwin or mingw, and not anything > from microsoft, that is providing it). The procedure "provided by > windows" (provided by MSVC, actually) that does that is in fact called > WinMainCRTStartup. WinMainCRTStartup isn't the replacement for main. It's the replacement for begin or location zero back in the old days. (Anybody remember seeing p&P6 printed by errant programs?). There are different versions of that CRT startup (actually all compiled from the same module with ifdefs) that start: main - for non-MFC console apps wmain - same thing but with wchar_t arguments (SOMETHING C/C++ standards hasn't ever addressed to my satisfaction). WinMain - MFC main function wWinMain - Ditto, with wchar_t Actually the bulk of the CRT involves converting between the command line argument as a string and argc/argv (something UNIX does by the OS), and some gook necessary to support C++. The fake UNIX environment (POSIX) (read/write/seek, etc...) actually is NOT initialized here, but when it is actually referenced. -------------- next part -------------- An HTML attachment was scrubbed... URL: