diff -Naur bc-1.07.1-orig/bc/main.c bc-1.07.1/bc/main.c --- bc-1.07.1-orig/bc/main.c 2017-04-07 17:20:02.000000000 -0500 +++ bc-1.07.1/bc/main.c 2022-01-10 22:00:50.009302332 -0600 @@ -33,6 +33,10 @@ #include "proto.h" #include "getopt.h" +#ifdef _WIN32 +#include +#include +#endif /* Variables for processing multiple files. */ static char first_file; @@ -171,7 +175,10 @@ if (isatty(0) && isatty(1)) interactive = TRUE; -#ifdef HAVE_SETVBUF +#ifdef _WIN32 + _setmode(_fileno(stdout), _O_BINARY); + (void)setvbuf(stdout, NULL, _IONBF, 0); +#elif defined(HAVE_SETVBUF) /* attempt to simplify interaction with applications such as emacs */ (void) setvbuf(stdout, NULL, _IOLBF, 0); #endif