Mail Archives: djgpp/1995/10/02/23:01:28
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)
- Raw text -