diff --git a/src/pcre2grep.c b/src/pcre2grep.c index 231d356..47d2a4e 100644 --- a/src/pcre2grep.c +++ b/src/pcre2grep.c @@ -58,6 +58,11 @@ POSSIBILITY OF SUCH DAMAGE. #include #include +#if defined(_WIN32) || defined(WIN32) +#include /* For _setmode() */ +#include /* For _O_BINARY */ +#endif + #ifdef SUPPORT_PCRE2GREP_CALLOUT #include #endif @@ -2923,7 +2928,7 @@ that stdout is a binary stream. Note that this means all other output to stdout must use STDOUT_NL to terminate lines. */ #if defined(_WIN32) || defined(WIN32) -setmode(fileno(stdout), O_BINARY); +_setmode( _fileno(stdout), _O_BINARY); #endif /* Set up a default compile and match contexts and a match data block. */