JonY wrote:
According to <http://www.lesstif.org/~amai/os2/html/porting.html>,
setmode looks to be available on OS/2.
Can we agree to use setmode?
I have found that minigzip.c[1] from zlib uses this for Cygwin and OS/2:
setmode(fileno(file), O_BINARY)
[1]http://www.sfr-fresh.com/unix/misc/zlib-1.2.5.tar.gz:a/zlib-1.2.5/minigzip.c
(see line 38).
So I plan to include the following near the beginning of main():
#if defined(OS2) || defined(__CYGWIN__)
setmode( STDIN_FILENO, O_BINARY );
setmode( STDOUT_FILENO, O_BINARY );
#endif
Elbert, JonY, can you check if this works both on Cygwin and OS/2? Thanks.