The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: ron@ronnatalie.com (Ronald Natalie)
Subject: [TUHS] why the leading under score added to function names?
Date: Sun, 26 Feb 2012 08:28:36 -0500	[thread overview]
Message-ID: <29D22528-0E74-4465-BA18-BF3DDE1BB674@ronnatalie.com> (raw)
In-Reply-To: <4F495D84.8030206@fastmail.us>


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: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20120226/8dc5369c/attachment.html>


  reply	other threads:[~2012-02-26 13:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 19:17 arnold
2012-02-22 21:22 ` Dave Horsfall
2012-02-22 22:47   ` A. P. Garcia
2012-02-23  4:30   ` Greg 'groggy' Lehey
2012-02-25 18:45     ` Random832
2012-02-25 19:24       ` Steve Nickolas
2012-02-25 20:39       ` John Cowan
2012-02-25 22:15         ` Random832
2012-02-26 13:28           ` Ronald Natalie [this message]
2012-02-27  1:30             ` random832
  -- strict thread matches above, loose matches on Subject: below --
2012-02-20 20:52 arnold
2012-02-20 23:21 ` Dave Horsfall
2012-02-21  0:34   ` Brantley Coile
2012-02-21  2:50     ` Warner Losh
2012-02-21  3:33       ` John Cowan
2012-02-21  3:41       ` Steve Nickolas
2012-02-21 18:18       ` ron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29D22528-0E74-4465-BA18-BF3DDE1BB674@ronnatalie.com \
    --to=ron@ronnatalie.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).