Xref: news-dnh.mv.net comp.os.msdos.djgpp:2334 Newsgroups: comp.os.msdos.djgpp Path: news-dnh.mv.net!mv!news.sprintlink.net!EU.net!sun4nl!phcoms4.seri.philips.nl!newssvr!kunst From: kunst AT prl DOT philips DOT nl (Pieter Kunst) Subject: Re: ios::binary Sender: news AT prl DOT philips DOT nl (USENET News System) Organization: Philips Research Laboratories, Eindhoven, The Netherlands References: <812397940snz AT chocolat DOT demon DOT co DOT uk> Date: Mon, 2 Oct 1995 12:14:53 GMT Lines: 29 To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp In article <812397940snz AT chocolat DOT demon DOT co DOT uk> PS AT chocolat DOT demon DOT co DOT uk writes: > >Well, I've just been bitten again by the ios::bin v ios::binary >difference between gcc and Borland,Watcom and who knows what other >PC compilers. > >My current hack is to add a new 'binary = _IOS_BIN' to streambuf.h > >There must be a better way than hacking the include files. If not >could we have the alias added to any new djgcc releases? > > >just in case... the problem is > > ofstream afile("name",ios::bin | ios::in); > >is incompatible with most PC compilers. In the upcoming Standard C++ Library (see: P.J. Plauger, "The Draft Standard C++ Library", Prentice Hall, ISBN 0-13-117003-1) six constants are defined for 'openmode': app, ate, binary, in, out, trunc (p.113 Plauger) It seems practical to stick as close to this upcoming standard as possible. But I guess this discussion is more gcc-related than DJGPP-related. Pieter Kunst (kunst AT natlab DOT research DOT philips DOT com)