Skip to content

Commit 380a4d9

Browse files
mark987peff
authored andcommitted
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 <[email protected]> Signed-off-by: Jeff King <[email protected]>
1 parent b0b00a3 commit 380a4d9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ ifeq ($(uname_O),Cygwin)
10861086
NO_SYMLINK_HEAD = YesPlease
10871087
NO_IPV6 = YesPlease
10881088
OLD_ICONV = UnfortunatelyYes
1089+
V15_MINGW_HEADERS = YesPlease
10891090
endif
10901091
NO_THREAD_SAFE_PREAD = YesPlease
10911092
NEEDS_LIBICONV = YesPlease
@@ -1893,6 +1894,9 @@ ifdef NO_REGEX
18931894
COMPAT_CFLAGS += -Icompat/regex
18941895
COMPAT_OBJS += compat/regex/regex.o
18951896
endif
1897+
ifdef V15_MINGW_HEADERS
1898+
COMPAT_CFLAGS += -DV15_MINGW_HEADERS
1899+
endif
18961900

18971901
ifdef USE_NED_ALLOCATOR
18981902
COMPAT_CFLAGS += -Icompat/nedmalloc

compat/cygwin.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#define WIN32_LEAN_AND_MEAN
2+
#ifdef V15_MINGW_HEADERS
23
#include "../git-compat-util.h"
34
#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
411
#include "../cache.h" /* to read configuration */
512

613
static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)

0 commit comments

Comments
 (0)