diff --git a/ChangeLog b/ChangeLog index ee2791a..28cb2b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -220,7 +220,8 @@ Unicode Standard Annex #29. (pcre2_pattern_convert() and friends). 51. Change the macro FWRITE, used in pcre2grep, to FWRITE_IGNORE because FWRITE -is defined in a system header in cygwin. +is defined in a system header in cygwin. Also modified some of the #ifdefs in +pcre2grep related to Windows and Cygwin support. Version 10.23 14-February-2017 diff --git a/src/pcre2grep.c b/src/pcre2grep.c index 4806aa0..fcd5f12 100644 --- a/src/pcre2grep.c +++ b/src/pcre2grep.c @@ -58,7 +58,13 @@ POSSIBILITY OF SUCH DAMAGE. #include #include -#if (defined _WIN32 || (defined HAVE_WINDOWS_H && HAVE_WINDOWS_H)) && !defined WIN32 +#if (defined _WIN32 || (defined HAVE_WINDOWS_H && HAVE_WINDOWS_H)) \ + && !defined WIN32 && !defined(__CYGWIN__) +#define WIN32 +#endif + +/* Some cmake's define it still */ +#if defined(__CYGWIN__) && !defined(WIN32) #define WIN32 #endif