[Pcre-svn] [849] code/trunk: Modify #ifdefs for Cygwin.

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [849] code/trunk: Modify #ifdefs for Cygwin.
Revision: 849
          http://www.exim.org/viewvc/pcre2?view=rev&revision=849
Author:   ph10
Date:     2017-07-27 17:17:19 +0100 (Thu, 27 Jul 2017)
Log Message:
-----------
Modify #ifdefs for Cygwin.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2grep.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2017-07-25 15:27:30 UTC (rev 848)
+++ code/trunk/ChangeLog    2017-07-27 16:17:19 UTC (rev 849)
@@ -220,7 +220,8 @@
 (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

Modified: code/trunk/src/pcre2grep.c
===================================================================
--- code/trunk/src/pcre2grep.c    2017-07-25 15:27:30 UTC (rev 848)
+++ code/trunk/src/pcre2grep.c    2017-07-27 16:17:19 UTC (rev 849)
@@ -58,10 +58,16 @@
 #include <sys/types.h>
 #include <sys/stat.h>


-#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
+
 #ifdef WIN32
 #include <io.h>                /* For _setmode() */
 #include <fcntl.h>             /* For _O_BINARY */