{"thread":{"id":"32084","subject":"[PATCH] Update cygwin.c for new mingw-64 win32 api headers","startedAt":"2012-11-12T00:17:20Z","lastAt":"2012-11-12T21:43:52Z","messageCount":4,"participants":["Mark Levedahl","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"202932","messageId":"1352679440-4098-1-git-send-email-mlevedahl@gmail.com","threadId":"32084","inReplyTo":null,"subject":"[PATCH] Update cygwin.c for new mingw-64 win32 api headers","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2012-11-12T00:17:20Z","receivedAt":"2012-11-12T00:17:20Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"The cygwin project recently switched to a new implementation of the\nwindows api, now using header files from the mingw-64 project. These\nnew header files are incompatible with the way cygwin.c included the\nold headers: cygwin.c can be compiled using the new or the older (mingw)\nheaders, but different files must be included in different order for each\nto work. The new headers are in use only for the current release series\n(based upon the v1.7.x dll version). The previous release series using\nthe v1.5 dll is kept available but unmaintained for use on older versions\nof Windows. So, patch cygwin.c to use the new include ordering only if\nthe dll version is 1.7 or higher.\n\nSigned-off-by: Mark Levedahl <mlevedahl@gmail.com>\n---\n Makefile        | 4 ++++\n compat/cygwin.c | 7 +++++++\n 2 files changed, 11 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex f69979e..1cc5d96 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1082,6 +1082,7 @@ ifeq ($(uname_O),Cygwin)\n \t\tNO_SYMLINK_HEAD = YesPlease\n \t\tNO_IPV6 = YesPlease\n \t\tOLD_ICONV = UnfortunatelyYes\n+\t\tV15_MINGW_HEADERS = YesPlease\n \tendif\n \tNO_THREAD_SAFE_PREAD = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n@@ -1889,6 +1890,9 @@ ifdef NO_REGEX\n \tCOMPAT_CFLAGS += -Icompat/regex\n \tCOMPAT_OBJS += compat/regex/regex.o\n endif\n+ifdef V15_MINGW_HEADERS\n+\tCOMPAT_CFLAGS += -DV15_MINGW_HEADERS\n+endif\n \n ifdef USE_NED_ALLOCATOR\n        COMPAT_CFLAGS += -Icompat/nedmalloc\ndiff --git a/compat/cygwin.c b/compat/cygwin.c\nindex dfe9b30..59d86e4 100644\n--- a/compat/cygwin.c\n+++ b/compat/cygwin.c\n@@ -1,6 +1,13 @@\n #define WIN32_LEAN_AND_MEAN\n+#ifdef V15_MINGW_HEADERS\n #include \"../git-compat-util.h\"\n #include \"win32.h\"\n+#else\n+#include <sys/stat.h>\n+#include <sys/errno.h>\n+#include \"win32.h\"\n+#include \"../git-compat-util.h\"\n+#endif\n #include \"../cache.h\" /* to read configuration */\n \n static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)\n-- \n1.8.0.0.0.14\n"},{"id":"202999","messageId":"20121112205832.GI4623@sigill.intra.peff.net","threadId":"32084","inReplyTo":"1352679440-4098-1-git-send-email-mlevedahl@gmail.com","subject":"Re: [PATCH] Update cygwin.c for new mingw-64 win32 api headers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-11-12T20:58:32Z","receivedAt":"2012-11-12T20:58:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Nov 11, 2012 at 07:17:20PM -0500, Mark Levedahl wrote:\n\n> The cygwin project recently switched to a new implementation of the\n> windows api, now using header files from the mingw-64 project. These\n> new header files are incompatible with the way cygwin.c included the\n> old headers: cygwin.c can be compiled using the new or the older (mingw)\n> headers, but different files must be included in different order for each\n> to work. The new headers are in use only for the current release series\n> (based upon the v1.7.x dll version). The previous release series using\n> the v1.5 dll is kept available but unmaintained for use on older versions\n> of Windows. So, patch cygwin.c to use the new include ordering only if\n> the dll version is 1.7 or higher.\n\nI have very little knowledge of cygwin compatibility, so thanks for a\nnice explanation.  I'll queue it in 'pu' for now, and hopefully we can\nget some test reports from other cygwin folks (on new and old cygwin).\n\n> diff --git a/Makefile b/Makefile\n> index f69979e..1cc5d96 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1082,6 +1082,7 @@ ifeq ($(uname_O),Cygwin)\n>  \t\tNO_SYMLINK_HEAD = YesPlease\n>  \t\tNO_IPV6 = YesPlease\n>  \t\tOLD_ICONV = UnfortunatelyYes\n> +\t\tV15_MINGW_HEADERS = YesPlease\n>  \tendif\n\nThe \"if\" part of the conditional that did not make it into the context\nabove is an expr match for \"1.6.*\" From the name, I would think that we\nwould want to use these headers on cygwin 1.5.* , too. Is v1.5 too old\nto care about now?\n\n-Peff\n"},{"id":"203003","messageId":"CAK2bgnXLnKmnVwzE5U_1qZueUdj-QaT23f-iFmhJyRto3tWnhA@mail.gmail.com","threadId":"32084","inReplyTo":"20121112205832.GI4623@sigill.intra.peff.net","subject":"Re: [PATCH] Update cygwin.c for new mingw-64 win32 api headers","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2012-11-12T21:39:39Z","receivedAt":"2012-11-12T21:39:39Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"On Mon, Nov 12, 2012 at 3:58 PM, Jeff King <peff@peff.net> wrote:\n> On Sun, Nov 11, 2012 at 07:17:20PM -0500, Mark Levedahl wrote:\n>\n>> The cygwin project recently switched to a new implementation of the\n>> windows api, now using header files from the mingw-64 project. These\n>> new header files are incompatible with the way cygwin.c included the\n>> old headers: cygwin.c can be compiled using the new or the older (mingw)\n>> headers, but different files must be included in different order for each\n>> to work. The new headers are in use only for the current release series\n>> (based upon the v1.7.x dll version). The previous release series using\n>> the v1.5 dll is kept available but unmaintained for use on older versions\n>> of Windows. So, patch cygwin.c to use the new include ordering only if\n>> the dll version is 1.7 or higher.\n>\n> I have very little knowledge of cygwin compatibility, so thanks for a\n> nice explanation.  I'll queue it in 'pu' for now, and hopefully we can\n> get some test reports from other cygwin folks (on new and old cygwin).\n>\n>> diff --git a/Makefile b/Makefile\n>> index f69979e..1cc5d96 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -1082,6 +1082,7 @@ ifeq ($(uname_O),Cygwin)\n>>               NO_SYMLINK_HEAD = YesPlease\n>>               NO_IPV6 = YesPlease\n>>               OLD_ICONV = UnfortunatelyYes\n>> +             V15_MINGW_HEADERS = YesPlease\n>>       endif\n>\n> The \"if\" part of the conditional that did not make it into the context\n> above is an expr match for \"1.6.*\" From the name, I would think that we\n> would want to use these headers on cygwin 1.5.* , too. Is v1.5 too old\n> to care about now?\n>\n> -Peff\n\nThe opening if expression is:\n    ifeq ($(shell expr \"$(uname_R)\" : '1\\.[1-6]\\.'),4)\nwhich I believe matches any version below 1.7. 1.5 is what is released\nopensource, 1.6 is (or was) available as a supported product from\nredhat. So, I think the stanza is ok as is.\n\nMark\n"},{"id":"203005","messageId":"20121112214352.GB10531@sigill.intra.peff.net","threadId":"32084","inReplyTo":"CAK2bgnXLnKmnVwzE5U_1qZueUdj-QaT23f-iFmhJyRto3tWnhA@mail.gmail.com","subject":"Re: [PATCH] Update cygwin.c for new mingw-64 win32 api headers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-11-12T21:43:52Z","receivedAt":"2012-11-12T21:43:52Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 12, 2012 at 04:39:39PM -0500, Mark Levedahl wrote:\n\n> >> diff --git a/Makefile b/Makefile\n> >> index f69979e..1cc5d96 100644\n> >> --- a/Makefile\n> >> +++ b/Makefile\n> >> @@ -1082,6 +1082,7 @@ ifeq ($(uname_O),Cygwin)\n> >>               NO_SYMLINK_HEAD = YesPlease\n> >>               NO_IPV6 = YesPlease\n> >>               OLD_ICONV = UnfortunatelyYes\n> >> +             V15_MINGW_HEADERS = YesPlease\n> >>       endif\n> >\n> > The \"if\" part of the conditional that did not make it into the context\n> > above is an expr match for \"1.6.*\" From the name, I would think that we\n> > would want to use these headers on cygwin 1.5.* , too. Is v1.5 too old\n> > to care about now?\n> \n> The opening if expression is:\n>     ifeq ($(shell expr \"$(uname_R)\" : '1\\.[1-6]\\.'),4)\n> which I believe matches any version below 1.7. 1.5 is what is released\n> opensource, 1.6 is (or was) available as a supported product from\n> redhat. So, I think the stanza is ok as is.\n\nOh, right, I'm an idiot. I read the patch, thought \"gee, I wonder what\nthat conditional just outside the context is\", looked it up, then\npromptly misremembered exactly what it said when writing the rest of my\nemail.\n\nYes, what you have is absolutely right. Sorry for the noise.\n\n-Peff\n"}]}