According to the comments, perhaps a feature may be useful, such as the following (untested!):
#include <stdio.h>
#ifdef WIN32
#include <fcntl.h>
#include <io.h>
#endif
int SetBinary(FILE *pFile)
{
#ifdef WIN32
return _setmode(_fileno(pFile), O_BINARY);
#else
return setmode(_fileno(pFile), O_BINARY);
#endif
}
It looks ugly, so maybe you could conditionally #defineinstead of a function name, but I donβt think that someday it will be beautiful.
source
share