Revision: 510
http://www.exim.org/viewvc/pcre2?view=rev&revision=510
Author: ph10
Date: 2016-04-06 09:26:24 +0100 (Wed, 06 Apr 2016)
Log Message:
-----------
Tidy up patch for Windows binary stdout in pcre2grep.
Modified Paths:
--------------
code/trunk/src/pcre2grep.c
Modified: code/trunk/src/pcre2grep.c
===================================================================
--- code/trunk/src/pcre2grep.c 2016-04-06 08:19:45 UTC (rev 509)
+++ code/trunk/src/pcre2grep.c 2016-04-06 08:26:24 UTC (rev 510)
@@ -58,6 +58,11 @@
#include <sys/types.h>
#include <sys/stat.h>
+#if defined(_WIN32) || defined(WIN32)
+#include <io.h> /* For _setmode() */
+#include <fcntl.h> /* For _O_BINARY */
+#endif
+
#ifdef SUPPORT_PCRE2GREP_CALLOUT
#include <sys/wait.h>
#endif
@@ -2923,7 +2928,7 @@
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. */