{"thread":{"id":"28739","subject":"[PATCH 1/3] MSVC: Compile fix by not including sys/resources.h","startedAt":"2011-10-21T19:36:41Z","lastAt":"2011-10-22T00:56:45Z","messageCount":4,"participants":["Vincent van Ravesteijn","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"178142","messageId":"4EA1C9C9.9010904@lyx.org","threadId":"28739","inReplyTo":null,"subject":"[PATCH 1/3] MSVC: Compile fix by not including sys/resources.h","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2011-10-21T19:36:41Z","receivedAt":"2011-10-21T19:36:41Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"Fix compilation when compiling with MSVC because sys/resource.h\nis not available. This patch causes a number of other headerfiles\nthat are not available to be excluded as well.\n\nSigned-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n---\n  git-compat-util.h |   13 ++++++-------\n  1 files changed, 6 insertions(+), 7 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 5ef8ff7..53186da 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -116,7 +116,12 @@\n  #else\n  #include <poll.h>\n  #endif\n-#ifndef __MINGW32__\n+#if defined(__MINGW32__)\n+/* pull in Windows compatibility stuff */\n+#include \"compat/mingw.h\"\n+#elif defined(_MSC_VER)\n+#include \"compat/msvc.h\"\n+#else\n  #include <sys/wait.h>\n  #include <sys/resource.h>\n  #include <sys/socket.h>\n@@ -145,12 +150,6 @@\n  #include <grp.h>\n  #define _ALL_SOURCE 1\n  #endif\n-#else  /* __MINGW32__ */\n-/* pull in Windows compatibility stuff */\n-#include \"compat/mingw.h\"\n-#endif /* __MINGW32__ */\n-#ifdef _MSC_VER\n-#include \"compat/msvc.h\"\n  #endif\n\n  #ifndef NO_LIBGEN_H\n--\n1.7.6.msysgit.0\n"},{"id":"178144","messageId":"4EA1CA7E.5030301@lyx.org","threadId":"28739","inReplyTo":"4EA1C9C9.9010904@lyx.org","subject":"[PATCH 2/3] MSVC: Compile fix by including io.h","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2011-10-21T19:39:42Z","receivedAt":"2011-10-21T19:39:42Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"Include io.h when compiling with MSVC\n\nSigned-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n---\n  compat/msvc.h |    1 +\n  1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/compat/msvc.h b/compat/msvc.h\nindex a33b01c..aa4b563 100644\n--- a/compat/msvc.h\n+++ b/compat/msvc.h\n@@ -4,6 +4,7 @@\n  #include <direct.h>\n  #include <process.h>\n  #include <malloc.h>\n+#include <io.h>\n\n  /* porting function */\n  #define inline __inline\n--\n1.7.6.msysgit.0\n"},{"id":"178145","messageId":"4EA1CB41.6070609@lyx.org","threadId":"28739","inReplyTo":"4EA1C9C9.9010904@lyx.org","subject":"[PATCH 3/3] MSVC: Remove unneeded header stubs","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2011-10-21T19:42:57Z","receivedAt":"2011-10-21T19:42:57Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"These headers are not necessary anymore as they are no longer included\nin git-compat-util.h.\n\nSigned-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n---\n  compat/vcbuild/include/arpa/inet.h   |    1 -\n  compat/vcbuild/include/grp.h         |    1 -\n  compat/vcbuild/include/inttypes.h    |    1 -\n  compat/vcbuild/include/netdb.h       |    1 -\n  compat/vcbuild/include/netinet/in.h  |    1 -\n  compat/vcbuild/include/netinet/tcp.h |    1 -\n  compat/vcbuild/include/pwd.h         |    1 -\n  compat/vcbuild/include/sys/ioctl.h   |    1 -\n  compat/vcbuild/include/sys/select.h  |    1 -\n  compat/vcbuild/include/sys/socket.h  |    1 -\n  compat/vcbuild/include/sys/wait.h    |    1 -\n  compat/vcbuild/include/termios.h     |    1 -\n  12 files changed, 0 insertions(+), 12 deletions(-)\n  delete mode 100644 compat/vcbuild/include/arpa/inet.h\n  delete mode 100644 compat/vcbuild/include/grp.h\n  delete mode 100644 compat/vcbuild/include/inttypes.h\n  delete mode 100644 compat/vcbuild/include/netdb.h\n  delete mode 100644 compat/vcbuild/include/netinet/in.h\n  delete mode 100644 compat/vcbuild/include/netinet/tcp.h\n  delete mode 100644 compat/vcbuild/include/pwd.h\n  delete mode 100644 compat/vcbuild/include/sys/ioctl.h\n  delete mode 100644 compat/vcbuild/include/sys/select.h\n  delete mode 100644 compat/vcbuild/include/sys/socket.h\n  delete mode 100644 compat/vcbuild/include/sys/wait.h\n  delete mode 100644 compat/vcbuild/include/termios.h\n\ndiff --git a/compat/vcbuild/include/arpa/inet.h \nb/compat/vcbuild/include/arpa/inet.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/arpa/inet.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/grp.h b/compat/vcbuild/include/grp.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/grp.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/inttypes.h \nb/compat/vcbuild/include/inttypes.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/inttypes.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/netdb.h b/compat/vcbuild/include/netdb.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/netdb.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/netinet/in.h \nb/compat/vcbuild/include/netinet/in.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/netinet/in.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/netinet/tcp.h \nb/compat/vcbuild/include/netinet/tcp.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/netinet/tcp.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/pwd.h b/compat/vcbuild/include/pwd.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/pwd.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/sys/ioctl.h \nb/compat/vcbuild/include/sys/ioctl.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/sys/ioctl.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/sys/select.h \nb/compat/vcbuild/include/sys/select.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/sys/select.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/sys/socket.h \nb/compat/vcbuild/include/sys/socket.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/sys/socket.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/sys/wait.h \nb/compat/vcbuild/include/sys/wait.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/sys/wait.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\ndiff --git a/compat/vcbuild/include/termios.h \nb/compat/vcbuild/include/termios.h\ndeleted file mode 100644\nindex 0d8552a..0000000\n--- a/compat/vcbuild/include/termios.h\n+++ /dev/null\n@@ -1 +0,0 @@\n-/* Intentionally empty file to support building git with MSVC */\n-- \n1.7.6.msysgit.0\n"},{"id":"178156","messageId":"7vk47x7sj6.fsf@alter.siamese.dyndns.org","threadId":"28739","inReplyTo":"4EA1C9C9.9010904@lyx.org","subject":"Re: [PATCH 1/3] MSVC: Compile fix by not including sys/resources.h","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-22T00:56:45Z","receivedAt":"2011-10-22T00:56:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">> ...\n>> Subject: [PATCH 1/3] MSVC: Compile fix by not including sys/resources.h\n>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed\n........................................................^^^^^^\n\nCould you refrain from doing that?  It breaks the patch text.\n\nVincent van Ravesteijn <vfr@lyx.org> writes:\n\n> Fix compilation when compiling with MSVC because sys/resource.h\n> is not available. This patch causes a number of other headerfiles\n> that are not available to be excluded as well.\n>\n> Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n\nInstead of current\n\n\t#ifndef mingw32 is the only one that is strange\n        ... everything for systems that is not strainge ...\n        #else\n        ... include mingw specific tweaks ...\n        #endif\n        #ifdef msvc is also strange\n        ... include msvc specific tweaks ...\n        #endif\n\nit turns things around and says what it wants to achieve in a more direct\nway, i.e.\n\n\t#if mingw32\n        #include \"compat/mingw.h\"\n\t#elif msvc\n        #include \"compat/msvc.h\"\n\t#else\n        ... all the others ...\n\t#endif\n\nwhich makes it look simpler.\n"}]}