{"thread":{"id":"28973","subject":"[PATCH] Compile fix for MSVC: Move poll.h out of sys-folder","startedAt":"2011-11-18T13:47:50Z","lastAt":"2011-11-18T16:47:29Z","messageCount":5,"participants":["Vincent van Ravesteijn","Erik Faye-Lund"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"179699","messageId":"1321624070-4246-1-git-send-email-vfr@lyx.org","threadId":"28973","inReplyTo":null,"subject":"[PATCH] Compile fix for MSVC: Move poll.h out of sys-folder","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2011-11-18T13:47:50Z","receivedAt":"2011-11-18T13:47:50Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"In v1.7.7.1-432-g0f77dea (Oct 24 2011; Erik Faye-Lund; mingw: move\npoll out of sys-folder) poll.h was moved out of the compat/win32/sys\nfolder. As the change in the Makefile also affects the MSVC build,\nthe same must be done for poll.h in compat/vcbuild/include/sys/poll.h.\n\nSigned-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n---\n compat/vcbuild/include/poll.h     |    1 +\n compat/vcbuild/include/sys/poll.h |    1 -\n 2 files changed, 1 insertions(+), 1 deletions(-)\n create mode 100644 compat/vcbuild/include/poll.h\n delete mode 100644 compat/vcbuild/include/sys/poll.h\n\ndiff --git a/compat/vcbuild/include/poll.h b/compat/vcbuild/include/poll.h\nnew file mode 100644\nindex 0000000..0d8552a\n--- /dev/null\n+++ b/compat/vcbuild/include/poll.h\n@@ -0,0 +1 @@\n+/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/sys/poll.h b/compat/vcbuild/include/sys/poll.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/sys/poll.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\n-- \n1.7.4.1\n"},{"id":"179701","messageId":"CABPQNSa+ZjAMSxpBTqGW7P=v-tJTW_jdx3MO=vCpzc-z_XdHTg@mail.gmail.com","threadId":"28973","inReplyTo":"1321624070-4246-1-git-send-email-vfr@lyx.org","subject":"Re: [PATCH] Compile fix for MSVC: Move poll.h out of sys-folder","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-11-18T14:09:49Z","receivedAt":"2011-11-18T14:09:49Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Nov 18, 2011 at 2:47 PM, Vincent van Ravesteijn <vfr@lyx.org> wrote:\n> In v1.7.7.1-432-g0f77dea (Oct 24 2011; Erik Faye-Lund; mingw: move\n> poll out of sys-folder) poll.h was moved out of the compat/win32/sys\n> folder. As the change in the Makefile also affects the MSVC build,\n> the same must be done for poll.h in compat/vcbuild/include/sys/poll.h.\n>\n> Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n> ---\n>  compat/vcbuild/include/poll.h     |    1 +\n>  compat/vcbuild/include/sys/poll.h |    1 -\n>  2 files changed, 1 insertions(+), 1 deletions(-)\n>  create mode 100644 compat/vcbuild/include/poll.h\n>  delete mode 100644 compat/vcbuild/include/sys/poll.h\n>\n\nThis looks strange to me. vcbuild/include/poll.h will only prevent the\ncorrect header from being included, while compiling an linking against\ncompat/win32/poll.[co]... That seems dangerous to me, because the\ninterface might be declared differently.\n\nInstead, I think compat/vcbuild/include/poll.h should be removed, and\n_WIN32_WINNT set to a value below 0x600. That way the poll-stuff\ndoesn't get pulled in by winsock2.h (as it's Vista and above only).\n\nThis was already discussed in your \"[PATCHv2] Compile fix for MSVC\" thread:\nhttp://mid.gmane.org/CABPQNSaCRRRpEQPG1Mb4DovkMdQSBhHTm-i7y5M4iT+ndHX4XA@mail.gmail.com\n\nHere's the patch that fixes it. I still can't build Junio's master,\ndue to sys/resource.h missing. This comes from ebae9ff (\"compat: add\nmissing #include <sys/resource.h>\"), and is only guarded against\nMinGW, not MSVC...\n\n$ git diff\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex dfb0e87..a06269d 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -1,3 +1,4 @@\n+#define _WIN32_WINNT 0x0501\n #include <winsock2.h>\n #include <ws2tcpip.h>\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 5ef8ff7..c52be6c 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -85,6 +85,7 @@\n #define _SGI_SOURCE 1\n\n #ifdef WIN32 /* Both MinGW and MSVC */\n+#define _WIN32_WINNT 0x0501\n #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */\n #include <winsock2.h>\n #include <windows.h>\n"},{"id":"179704","messageId":"CABPQNSaV-TyznoOsRNQPYEWZCz553cuPOdRsyRQSpzU8QngBZA@mail.gmail.com","threadId":"28973","inReplyTo":"CABPQNSa+ZjAMSxpBTqGW7P=v-tJTW_jdx3MO=vCpzc-z_XdHTg@mail.gmail.com","subject":"Re: [PATCH] Compile fix for MSVC: Move poll.h out of sys-folder","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-11-18T14:28:42Z","receivedAt":"2011-11-18T14:28:42Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Nov 18, 2011 at 3:09 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n> On Fri, Nov 18, 2011 at 2:47 PM, Vincent van Ravesteijn <vfr@lyx.org> wrote:\n>> In v1.7.7.1-432-g0f77dea (Oct 24 2011; Erik Faye-Lund; mingw: move\n>> poll out of sys-folder) poll.h was moved out of the compat/win32/sys\n>> folder. As the change in the Makefile also affects the MSVC build,\n>> the same must be done for poll.h in compat/vcbuild/include/sys/poll.h.\n>>\n>> Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n>> ---\n>>  compat/vcbuild/include/poll.h     |    1 +\n>>  compat/vcbuild/include/sys/poll.h |    1 -\n>>  2 files changed, 1 insertions(+), 1 deletions(-)\n>>  create mode 100644 compat/vcbuild/include/poll.h\n>>  delete mode 100644 compat/vcbuild/include/sys/poll.h\n>>\n>\n> This looks strange to me. vcbuild/include/poll.h will only prevent the\n> correct header from being included, while compiling an linking against\n> compat/win32/poll.[co]... That seems dangerous to me, because the\n> interface might be declared differently.\n>\n> Instead, I think compat/vcbuild/include/poll.h should be removed, and\n> _WIN32_WINNT set to a value below 0x600. That way the poll-stuff\n> doesn't get pulled in by winsock2.h (as it's Vista and above only).\n>\n> This was already discussed in your \"[PATCHv2] Compile fix for MSVC\" thread:\n> http://mid.gmane.org/CABPQNSaCRRRpEQPG1Mb4DovkMdQSBhHTm-i7y5M4iT+ndHX4XA@mail.gmail.com\n>\n> Here's the patch that fixes it.\n\nJohannes Schindelin was nice enough to create a commit based on my\ne-mail, feel free to pick it up and submit it:\n\nhttps://github.com/msysgit/git/commit/9ca803910f3625bf686699f6b0bf71a8c68bccae\n"},{"id":"179705","messageId":"4EC66EBF.20007@lyx.org","threadId":"28973","inReplyTo":"CABPQNSa+ZjAMSxpBTqGW7P=v-tJTW_jdx3MO=vCpzc-z_XdHTg@mail.gmail.com","subject":"Re: [PATCH] Compile fix for MSVC: Move poll.h out of sys-folder","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2011-11-18T14:42:07Z","receivedAt":"2011-11-18T14:42:07Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"> This looks strange to me. vcbuild/include/poll.h will only prevent the\n> correct header from being included, while compiling an linking against\n> compat/win32/poll.[co]... That seems dangerous to me, because the\n> interface might be declared differently.\n>\n> Instead, I think compat/vcbuild/include/poll.h should be removed,\n\nYes, it should just be removed. Having poll.h in the sys directory was \nwrong and the patch I sent was needed to make 0f77dea compile.\n\nYour patch is indeed necessary to compile later revisions as well.\n\n> I still can't build Junio's master,\n> due to sys/resource.h missing. This comes from ebae9ff (\"compat: add\n> missing #include<sys/resource.h>\"), and is only guarded against\n> MinGW, not MSVC...\n\nThe fix for this is already in 'next' now. So, with your patch, 'next' \ndoes compile.\n\nVincent\n"},{"id":"179709","messageId":"4EC68C21.7030902@lyx.org","threadId":"28973","inReplyTo":"CABPQNSaV-TyznoOsRNQPYEWZCz553cuPOdRsyRQSpzU8QngBZA@mail.gmail.com","subject":"Re: [PATCH] Compile fix for MSVC: Move poll.h out of sys-folder","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2011-11-18T16:47:29Z","receivedAt":"2011-11-18T16:47:29Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"Op 18-11-2011 15:28, Erik Faye-Lund schreef:\n> On Fri, Nov 18, 2011 at 3:09 PM, Erik Faye-Lund<kusmabite@gmail.com>  wrote:\n>> On Fri, Nov 18, 2011 at 2:47 PM, Vincent van Ravesteijn<vfr@lyx.org>  wrote:\n>>> In v1.7.7.1-432-g0f77dea (Oct 24 2011; Erik Faye-Lund; mingw: move\n>>> poll out of sys-folder) poll.h was moved out of the compat/win32/sys\n>>> folder. As the change in the Makefile also affects the MSVC build,\n>>> the same must be done for poll.h in compat/vcbuild/include/sys/poll.h.\n>>>\n>>> Signed-off-by: Vincent van Ravesteijn<vfr@lyx.org>\n>>> ---\n>>>   compat/vcbuild/include/poll.h     |    1 +\n>>>   compat/vcbuild/include/sys/poll.h |    1 -\n>>>   2 files changed, 1 insertions(+), 1 deletions(-)\n>>>   create mode 100644 compat/vcbuild/include/poll.h\n>>>   delete mode 100644 compat/vcbuild/include/sys/poll.h\n>>>\n>> This looks strange to me. vcbuild/include/poll.h will only prevent the\n>> correct header from being included, while compiling an linking against\n>> compat/win32/poll.[co]... That seems dangerous to me, because the\n>> interface might be declared differently.\n>>\n>> Instead, I think compat/vcbuild/include/poll.h should be removed, and\n>> _WIN32_WINNT set to a value below 0x600. That way the poll-stuff\n>> doesn't get pulled in by winsock2.h (as it's Vista and above only).\n>>\n>> This was already discussed in your \"[PATCHv2] Compile fix for MSVC\" thread:\n>> http://mid.gmane.org/CABPQNSaCRRRpEQPG1Mb4DovkMdQSBhHTm-i7y5M4iT+ndHX4XA@mail.gmail.com\n>>\n>> Here's the patch that fixes it.\n> Johannes Schindelin was nice enough to create a commit based on my\n> e-mail, feel free to pick it up and submit it:\n>\n> https://github.com/msysgit/git/commit/9ca803910f3625bf686699f6b0bf71a8c68bccae\n\nI resended a patch series including this one.\n\nVincent\n"}]}