Hi, On Mon, 2008-02-11 at 10:55 +0000, Hywel B. Richards wrote: > Quite a while ago when I first started using cegcc I ran into a problem > when using cegcc-compiled DLLs with microsoft-compiled executables: > > > > My workaround was to add a call to _initstdio() in a special init > > > function in my DLL that I call before I make any other calls to the > > DLL. > > > Now everything seems to work OK. > > > > To be safe, you should call (untested): > > __init_c__(); /* and then */ > > __initstdio(); > > > > > Can someone tell me if that is a reasonable workaround? Also, am I > > right > > > in thinking that this problem is already fixed now in SVN? (I've been > > > using the cygwin v0.1.0 version). > > > > Yes, this should be fixed in svn. > > > > Cheers, > > Pedro Alves > > Just to let you know, it seems that this is still a problem in versions > 0.50 and 0.51 (the cegcc-cegcc versions), i.e. you still need to call > _initstdio() if you want any file access to work at all. The behaviour > is a bit different in that instead of getting stuck and using lots of > CPU it just fails to read or write any data (but that could be a > difference in my program). Again, if I call _initstdio() before I use > any of the DLL functions then everything works perfectly. >
DLLs have the unique ability to run code when loaded. (as opposed to linux .so libraries) This is its own init. Possibly the _initstdio() call could be migrated there? > Using the DLL from a cegcc exe is also fine (without calling > _initstdio(), presumably because the exe itself sets all this up. > > Hywel. > > Jan Rinze. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Cegcc-devel mailing list Cegcc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cegcc-devel