summaryrefslogtreecommitdiff
path: root/src/pcre2grep.c
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2017-04-08 15:21:39 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2017-04-08 15:21:39 +0000
commit8a6312e6bc4f8dba8f63e97c9f1d9a50ef583ba7 (patch)
treea14336721df414158e933ff0c97de15ac7d03e62 /src/pcre2grep.c
parent09fe1a58ca56a5f91acf22d8135d73b71ff3cfba (diff)
downloadpcre2-8a6312e6bc4f8dba8f63e97c9f1d9a50ef583ba7.tar.gz
Documentation tidies and code tidies for Windows.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@737 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src/pcre2grep.c')
-rw-r--r--src/pcre2grep.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/pcre2grep.c b/src/pcre2grep.c
index a12086b..f282e9e 100644
--- a/src/pcre2grep.c
+++ b/src/pcre2grep.c
@@ -630,11 +630,24 @@ Unix-style directory scanning can be used (see below). */
#ifdef WIN32
+#ifndef STRICT
+# define STRICT
+#endif
+#ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
+
+#include <windows.h>
+
#define iswild(name) (strpbrk(name, "*?") != NULL)
/* Convert ANSI BGR format to RGB used by Windows */
#define BGR_RGB(x) ((x & 1 ? 4 : 0) | (x & 2) | (x & 4 ? 1 : 0))
+static HANDLE hstdout;
+static CONSOLE_SCREEN_BUFFER_INFO csbi;
+static WORD match_colour;
+
static WORD
decode_ANSI_colour(const char *cs)
{
@@ -817,15 +830,6 @@ when it did not exist. David Byron added a patch that moved the #include of
#elif defined WIN32
-#ifndef STRICT
-# define STRICT
-#endif
-#ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-
-#include <windows.h>
-
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES 0xFFFFFFFF
#endif
@@ -940,10 +944,6 @@ return _isatty(_fileno(f));
/************* Print optionally coloured match in Windows **********/
-static HANDLE hstdout;
-static CONSOLE_SCREEN_BUFFER_INFO csbi;
-static WORD match_colour;
-
static void
print_match(const void *buf, int length)
{