Page 1 of 1

Substitute _CRT_fmode

Posted: Fri Mar 29, 2013 2:52 am
by kosh
Hi Lutz.

in nl-filesys.c:76

Code: Select all

/* 
Set binary as default file mode for Windows.
See also http://www.mingw.org/MinGWiki/index.php/binary
*/
unsigned int _CRT_fmode = _O_BINARY;
This technique cannot available because of unimplemented in MinGW64.
and URL has changed to http://oldwiki.mingw.org/index.php/binary.

_setmode function is available to use mingw32 and 64.

Code: Select all

#include <stdio.h>
#include <fcntl.h>
#include <io.h>
...
int main(...) {
#if _WIN32
        _setmode(_fileno(stdin), _O_BINARY);
        _setmode(_fileno(stdout), _O_BINARY);
        _setmode(_fileno(stderr), _O_BINARY);
#endif
}
Regards.

Re: Substitute _CRT_fmode

Posted: Fri Mar 29, 2013 2:48 pm
by Lutz
Thanks for the research Kosh. I included your changes here:

http://www.newlisp.org/downloads/develo ... nprogress/

I have not yet made anta40's change in the other thread here:

http://newlispfanclub.alh.net/forum/vie ... 264#p21264

... out-commenting the definition of _matherr, because I need to look at the handling of this in the next MinGW version first.