* libc/stdio/stdio.c (__stextmode): new, see if file is text mode
(__sread): always read in binary mode (__swrite): always write in binary mode * libc/include/stdio.h: no getc/putc macros for cygwin; causes compatibility issues with different dll versions * libc/stdio/fopen.c: use __stextmode * libc/stdio/fdopen.c: ditto * libc/stdio/freopen.c: ditto * libc/stdio/findfp.c: set up __SCLE for std{in,out,err} * libc/stdio/local.h: declare __stextmode
This commit is contained in:
@ -149,7 +149,7 @@ _DEFUN (freopen, (file, mode, fp),
|
||||
fp->_close = __sclose;
|
||||
|
||||
#ifdef __SCLE
|
||||
if (setmode(fp->_file, O_BINARY) == O_TEXT)
|
||||
if (__stextmode(fp->_file))
|
||||
fp->_flags |= __SCLE;
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user