From 380a4d927bff693c42fc6b22c3547bdcaac4bdc3 Mon Sep 17 00:00:00 2001 From: Mark Levedahl Date: Sun, 11 Nov 2012 19:17:20 -0500 Subject: [PATCH 1/2] 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 Signed-off-by: Jeff King --- Makefile | 4 ++++ compat/cygwin.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/Makefile b/Makefile index 53a766e28..504ce6ced 100644 --- a/Makefile +++ b/Makefile @@ -1086,6 +1086,7 @@ ifeq ($(uname_O),Cygwin) NO_SYMLINK_HEAD = YesPlease NO_IPV6 = YesPlease OLD_ICONV = UnfortunatelyYes + V15_MINGW_HEADERS = YesPlease endif NO_THREAD_SAFE_PREAD = YesPlease NEEDS_LIBICONV = YesPlease @@ -1893,6 +1894,9 @@ ifdef NO_REGEX COMPAT_CFLAGS += -Icompat/regex COMPAT_OBJS += compat/regex/regex.o endif +ifdef V15_MINGW_HEADERS + COMPAT_CFLAGS += -DV15_MINGW_HEADERS +endif ifdef USE_NED_ALLOCATOR COMPAT_CFLAGS += -Icompat/nedmalloc diff --git a/compat/cygwin.c b/compat/cygwin.c index dfe9b3084..59d86e4d1 100644 --- a/compat/cygwin.c +++ b/compat/cygwin.c @@ -1,6 +1,13 @@ #define WIN32_LEAN_AND_MEAN +#ifdef V15_MINGW_HEADERS #include "../git-compat-util.h" #include "win32.h" +#else +#include +#include +#include "win32.h" +#include "../git-compat-util.h" +#endif #include "../cache.h" /* to read configuration */ static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts) From 9fca6cffc05321445b59c91e8f8d308f41588b53 Mon Sep 17 00:00:00 2001 From: Mark Levedahl Date: Sun, 18 Nov 2012 16:16:52 -0500 Subject: [PATCH 2/2] USE CGYWIN_V15_WIN32API as macro to select api for cygwin The previous macro was confusing to some, and did not include "cygwin" in its name. The updated name more clearly expresses a choice of the win32api implementation that shipped with version 1.5 of cygwin. Signed-off-by: Mark Levedahl Signed-off-by: Junio C Hamano --- Makefile | 6 +++--- compat/cygwin.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 504ce6ced..4d47af5d6 100644 --- a/Makefile +++ b/Makefile @@ -1086,7 +1086,7 @@ ifeq ($(uname_O),Cygwin) NO_SYMLINK_HEAD = YesPlease NO_IPV6 = YesPlease OLD_ICONV = UnfortunatelyYes - V15_MINGW_HEADERS = YesPlease + CYGWIN_V15_WIN32API = YesPlease endif NO_THREAD_SAFE_PREAD = YesPlease NEEDS_LIBICONV = YesPlease @@ -1894,8 +1894,8 @@ ifdef NO_REGEX COMPAT_CFLAGS += -Icompat/regex COMPAT_OBJS += compat/regex/regex.o endif -ifdef V15_MINGW_HEADERS - COMPAT_CFLAGS += -DV15_MINGW_HEADERS +ifdef CYGWIN_V15_WIN32API + COMPAT_CFLAGS += -DCYGWIN_V15_WIN32API endif ifdef USE_NED_ALLOCATOR diff --git a/compat/cygwin.c b/compat/cygwin.c index 59d86e4d1..542885887 100644 --- a/compat/cygwin.c +++ b/compat/cygwin.c @@ -1,5 +1,5 @@ #define WIN32_LEAN_AND_MEAN -#ifdef V15_MINGW_HEADERS +#ifdef CYGWIN_V15_WIN32API #include "../git-compat-util.h" #include "win32.h" #else