|
From: Earnie B. <ear...@ya...> - 2002-10-02 22:58:50
|
Danny Smith wrote: > > ----- Original Message ----- > From: "Veldkamp, Michiel" <mic...@at...> > To: "'min...@li...'" <min...@li...> > Sent: Wednesday, 2 October 2002 17:33 > Subject: Re: [Mingw-users] Initializing _fmode > > > "Earnie Boyd" wrote: > > > > > What happens with `unsigned int _fmode = _O_BINARY;'? > > > > It builds, but has no effect. It seems as if a new > > variable is created. > > > > Two points: > 1) according to MSDN docs > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/h > tml/_crt__fmode.asp > I didn't find this one. > _fmode is declared as int , not unsigned > it is declared in stdlib.h, not fcntl.h > I did find this. > 2) The _CRT_fmode mechanism in place in current mingw does a bit more > than what Michiel's example would do: It also changes mode of stdin, > stderr, and stdout. > > It is possible to have the _fmode/binmode.o mechanism working as per > MSDN docs (set mode of everyhing except std file handles) as well as > the mingw specific _CRT_fmode mechanism. Is that desirable? > Yes, binmode.o for _fmode and CRTbinmode.o to affect _CRT_fmode. I'm also thinking we need to clean up fcntl.h to remove the #define and appropriate define _fmode in stdlib.h. Dependency Walker (www.dependencywalker.com) shows some other interesting fmode items such as __p__fmode. Earnie. |