/* binmode_main.h - Don Yang (uguu.org) Preprocessor hack to replace main() with one that calls _setmode first. This is so that we can set stdin and stdout to be in binary mode for MingW without changing the source. 12/21/11 */ #ifdef __MINGW32__ #include #include #include #define main \ binmode_main(int argc, char **argv); \ int main(int argc, char **argv) \ { \ _setmode(_fileno(stdin), _O_BINARY); \ _setmode(_fileno(stdout), _O_BINARY); \ return binmode_main(argc, argv); \ } \ int binmode_main #endif