From f9bba0a50fafc7868630767a55cde9f5a16b8d76 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 5 Jan 2015 21:18:10 +0000 Subject: Changes to allow building with MinGW-w64 --- libbb/appletlib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libbb') diff --git a/libbb/appletlib.c b/libbb/appletlib.c index b74b6e724..dba66cc93 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -828,6 +828,18 @@ int main(int argc UNUSED_PARAM, char **argv) } #endif +#if defined(__MINGW64_VERSION_MAJOR) + if ( stdin ) { + _setmode(fileno(stdin), _O_BINARY); + } + if ( stdout ) { + _setmode(fileno(stdout), _O_BINARY); + } + if ( stderr ) { + _setmode(fileno(stderr), _O_BINARY); + } +#endif + #if defined(SINGLE_APPLET_MAIN) /* Only one applet is selected in .config */ if (argv[1] && strncmp(argv[0], "busybox", 7) == 0) { -- cgit v1.2.3-55-g6feb