delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/10/31/11:24:15

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199910311514.JAA21416@pluto.xraylith.wisc.edu>
To: "Colin Peters" <colinp AT ma DOT kcom DOT ne DOT jp>
cc: "GNU-win32" <cygwin AT sourceware DOT cygnus DOT com>, uf657 AT victoria DOT tc DOT ca
Subject: Re: mingw32 DLL getting main args?
In-Reply-To: Your message of "Sun, 31 Oct 1999 22:39:29 +0900."
<LOBBLDDPANDBNCLMBAGPKEDICCAA DOT colinp AT ma DOT kcom DOT ne DOT jp>
Date: Sun, 31 Oct 1999 09:14:48 -0600
From: Mumit Khan <khan AT thor DOT xraylith DOT wisc DOT edu>

"Colin Peters" <colinp AT ma DOT kcom DOT ne DOT jp> writes:
> 
> The reason DLLs call getmainargs to parse the command line list
> is so that they can provide the MS-like _argc and _argv variables for
> access by functions within the DLL. Check init.c, which is #included
> (yuck) in dllcrt1.c. If you like you can remove the declarations from
> stdlib.h and work up a DLL version of init.c to remove the dependency
> of your DLL on the C run-time library. (I suspect this hasn't changed
> in Mumit's version, I must admit I only checked my source.)
> 
> I suppose the other reason I didn't worry much about this was that I
> wasn't expecting people to write much DLL code without calling any
> C library functions.

We can actually avoid some of these issues by importing argc and argv
from the CRTDLL and MSVCRT directly instead of providing static 
definitions created at startup. I believe that's what MSVCRT dynamic
startup does, and Mingw currently provides the behaviour of static LIBC
instead. It works of course, and that's probably the reason why it hasn't
been a problem till now.

I'll take a look at the DLL issue and see what we can do without breaking
existing code.

Colin, if you would like a newer snapshot, please let me know.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019