Update cygwin.c for new mingw-64 win32 api headers

The cygwin project recently switched to a new implementation of the windows api, now using header files from the mingw-64 project. These new header files are incompatible with the way cygwin.c included the old headers: cygwin.c can be compiled using the new or the older (mingw) headers, but different files must be included in different order for each to work. The new headers are in use only for the current release series (based upon the v1.7.x dll version). The previous release series using the v1.5 dll is kept available but unmaintained for use on older versions of Windows. So, patch cygwin.c to use the new include ordering only if the dll version is 1.7 or higher. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Jeff King <peff@peff.net>

Mark Levedahl committed Nov 11, 2012 at 19:17 UTC 380a4d927bff693c42fc6b22c3547bdcaac4bdc3
2 files changed +11
Makefile
+4
@@ -1086,6 +1086,7 @@ ifeq ($(uname_O),Cygwin)
1086 NO_SYMLINK_HEAD = YesPlease
1087 NO_IPV6 = YesPlease
1088 OLD_ICONV = UnfortunatelyYes
1089 + V15_MINGW_HEADERS = YesPlease
1090 endif
1091 NO_THREAD_SAFE_PREAD = YesPlease
1092 NEEDS_LIBICONV = YesPlease
@@ -1893,6 +1894,9 @@ ifdef NO_REGEX
1894 COMPAT_CFLAGS += -Icompat/regex
1895 COMPAT_OBJS += compat/regex/regex.o
1896 endif
1897 +ifdef V15_MINGW_HEADERS
1898 + COMPAT_CFLAGS += -DV15_MINGW_HEADERS
1899 +endif
1900
1901 ifdef USE_NED_ALLOCATOR
1902 COMPAT_CFLAGS += -Icompat/nedmalloc
compat/cygwin.c
+7
@@ -1,6 +1,13 @@
1 #define WIN32_LEAN_AND_MEAN
2 +#ifdef V15_MINGW_HEADERS
3 #include "../git-compat-util.h"
4 #include "win32.h"
5 +#else
6 +#include <sys/stat.h>
7 +#include <sys/errno.h>
8 +#include "win32.h"
9 +#include "../git-compat-util.h"
10 +#endif
11 #include "../cache.h" /* to read configuration */
12
13 static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)