ack/modules/src/system/setbinarymode.c
David Given 28d4480f62 It turns out that you can't use freopen() to set binary mode of
stdin/stdout on Windows; so add a new system function called
sys_setbinarymode which does it instead. Then find lots more binary mode
flags which need setting.
2022-07-17 20:47:53 +02:00

14 lines
206 B
C

#include "system.h"
#include <fcntl.h>
#if defined WIN32
#include <io.h>
#endif
void sys_setbinarymode(FILE* fp)
{
#if defined WIN32
setmode(fileno(fp), O_BINARY);
#endif
}