From: fjh AT cs DOT mu DOT OZ DOT AU (Fergus Henderson) Subject: Re: Global data in DLL's how? 25 May 1998 06:33:57 -0700 Message-ID: <19980525140222.28006.cygnus.gnu-win32@murlibobo.cs.mu.OZ.AU> References: <199805240344 DOT UAA17250 AT prefetch-atm DOT san DOT rr DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: mlx AT san DOT rr DOT com Cc: Craig Setera , gnu-win32 AT cygnus DOT com On 23-May-1998, Steve Biskis wrote: > I don't know if the Gnu/Cygnus development environment > supports this but the MS prescribed way to change the > default behavior of globals so that they may be shared > by all attached processes is to add a directive like the > following to your DLL's entry module: > > #pragma data_seg( ".GLOBALS" ) > int nProcesses =0; > int nThreads =0; > #pragma data_seg() The gcc equivalent of this would be int nProcesses __attribute__((section(".GLOBALS")) = 0; int nThreads __attribute__((section(".GLOBALS")) = 0; However, I have no idea whether this works. I do know that the technique of using #define nProcesses (*__imp_nProcesses) works. (This technique is automated if you use my Makefile.DLLs, see .) -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh AT 128 DOT 250 DOT 37 DOT 3 | -- the last words of T. S. Garp. - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".