Skip to content

Commit 2f2c7e1

Browse files
committed
Merge branch 'ml/cygwin-mingw-headers'
Make git compile on cygwin with newer header files. * ml/cygwin-mingw-headers: USE CGYWIN_V15_WIN32API as macro to select api for cygwin Update cygwin.c for new mingw-64 win32 api headers
2 parents 9cfe5f4 + 9fca6cf commit 2f2c7e1

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+
CYGWIN_V15_WIN32API = YesPlease
10891090
endif
10901091
NO_THREAD_SAFE_PREAD = YesPlease
10911092
NEEDS_LIBICONV = YesPlease
@@ -1897,6 +1898,9 @@ ifdef NO_REGEX
18971898
COMPAT_CFLAGS += -Icompat/regex
18981899
COMPAT_OBJS += compat/regex/regex.o
18991900
endif
1901+
ifdef CYGWIN_V15_WIN32API
1902+
COMPAT_CFLAGS += -DCYGWIN_V15_WIN32API
1903+
endif
19001904

19011905
ifdef USE_NED_ALLOCATOR
19021906
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 CYGWIN_V15_WIN32API
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)