{"thread":{"id":"26130","subject":"[PATCH] msvc: Fix compilation error due to missing mktemp() declaration","startedAt":"2010-12-23T19:05:53Z","lastAt":"2011-01-01T20:26:02Z","messageCount":5,"participants":["Ramsay Jones","Erik Faye-Lund"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"158536","messageId":"4D139D91.8080503@ramsay1.demon.co.uk","threadId":"26130","inReplyTo":null,"subject":"[PATCH] msvc: Fix compilation error due to missing mktemp() declaration","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-23T19:05:53Z","receivedAt":"2010-12-23T19:05:53Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit d1b6e6e (win32: use our own dirent.h, 2010-11-23) removed\nthe compat/vcbuild/include/dirent.h compatibility header file.\nThis file, among other things, included the <io.h> system header\nfile which provides the declaration of the mktemp() function.\n\nIn order to fix the compilation error, we add an include directive\nfor <io.h> to the compat/vcbuild/include/unistd.h header. (The\nMinGW build includes <io.h> from it's <unistd.h> header too.)\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n compat/vcbuild/include/unistd.h |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\nindex b14fcf9..a61160f 100644\n--- a/compat/vcbuild/include/unistd.h\n+++ b/compat/vcbuild/include/unistd.h\n@@ -1,6 +1,8 @@\n #ifndef _UNISTD_\n #define _UNISTD_\n \n+#include <io.h>\n+\n /* Win32 define for porting git*/\n \n #ifndef _MODE_T_\n-- \n1.7.3\n"},{"id":"158542","messageId":"AANLkTineKS2e8PJs76PLZP4L4APwX2kAiFPg4pz3esae@mail.gmail.com","threadId":"26130","inReplyTo":"4D139D91.8080503@ramsay1.demon.co.uk","subject":"Re: [PATCH] msvc: Fix compilation error due to missing mktemp() declaration","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-12-24T01:00:26Z","receivedAt":"2010-12-24T01:00:26Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Thu, Dec 23, 2010 at 8:05 PM, Ramsay Jones\n<ramsay@ramsay1.demon.co.uk> wrote:\n>\n> Commit d1b6e6e (win32: use our own dirent.h, 2010-11-23) removed\n> the compat/vcbuild/include/dirent.h compatibility header file.\n> This file, among other things, included the <io.h> system header\n> file which provides the declaration of the mktemp() function.\n>\n> In order to fix the compilation error, we add an include directive\n> for <io.h> to the compat/vcbuild/include/unistd.h header. (The\n> MinGW build includes <io.h> from it's <unistd.h> header too.)\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n\nThanks. But shouldn't this header be included in mingw.h (or perhaps\nmsvc.h) because of _get_osfhandle and _commit?\n"},{"id":"158759","messageId":"4D1CDE84.7090402@ramsay1.demon.co.uk","threadId":"26130","inReplyTo":"AANLkTineKS2e8PJs76PLZP4L4APwX2kAiFPg4pz3esae@mail.gmail.com","subject":"Re: [PATCH] msvc: Fix compilation error due to missing mktemp() declaration","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-30T19:33:24Z","receivedAt":"2010-12-30T19:33:24Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Erik Faye-Lund wrote:\n> On Thu, Dec 23, 2010 at 8:05 PM, Ramsay Jones\n> <ramsay@ramsay1.demon.co.uk> wrote:\n>> Commit d1b6e6e (win32: use our own dirent.h, 2010-11-23) removed\n>> the compat/vcbuild/include/dirent.h compatibility header file.\n>> This file, among other things, included the <io.h> system header\n>> file which provides the declaration of the mktemp() function.\n>>\n>> In order to fix the compilation error, we add an include directive\n>> for <io.h> to the compat/vcbuild/include/unistd.h header. (The\n>> MinGW build includes <io.h> from it's <unistd.h> header too.)\n>>\n>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>> ---\n> \n> Thanks. But shouldn't this header be included in mingw.h (or perhaps\n> msvc.h) because of _get_osfhandle and _commit?\n\nEr... no. ;-)\n\nAll uses of _get_osfhandle() and _commit() on the msvc build (after this\npatch) are within the scope of an appropriate declaration, so there is\nno *need* to include <io.h> in either mingw.h or msvc.h.\n[I'm confident the same is true of the MinGW build as well, but I didn't\nhave time to check before sending this mail...]\n\nI suspect that you already know this and I'm just being dumb in missing\nthe import of your question... Perhaps you could clarify your concerns\nregarding this patch?\n\nATB,\nRamsay Jones\n"},{"id":"158767","messageId":"AANLkTinAAGWeFDomo-NQrVtrdf9ue1xVxufy+bkWz1Fc@mail.gmail.com","threadId":"26130","inReplyTo":"4D1CDE84.7090402@ramsay1.demon.co.uk","subject":"Re: [PATCH] msvc: Fix compilation error due to missing mktemp() declaration","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-12-30T21:47:04Z","receivedAt":"2010-12-30T21:47:04Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Thu, Dec 30, 2010 at 8:33 PM, Ramsay Jones\n<ramsay@ramsay1.demon.co.uk> wrote:\n> Erik Faye-Lund wrote:\n>> On Thu, Dec 23, 2010 at 8:05 PM, Ramsay Jones\n>> <ramsay@ramsay1.demon.co.uk> wrote:\n>>> Commit d1b6e6e (win32: use our own dirent.h, 2010-11-23) removed\n>>> the compat/vcbuild/include/dirent.h compatibility header file.\n>>> This file, among other things, included the <io.h> system header\n>>> file which provides the declaration of the mktemp() function.\n>>>\n>>> In order to fix the compilation error, we add an include directive\n>>> for <io.h> to the compat/vcbuild/include/unistd.h header. (The\n>>> MinGW build includes <io.h> from it's <unistd.h> header too.)\n>>>\n>>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>>> ---\n>>\n>> Thanks. But shouldn't this header be included in mingw.h (or perhaps\n>> msvc.h) because of _get_osfhandle and _commit?\n>\n> Er... no. ;-)\n>\n> All uses of _get_osfhandle() and _commit() on the msvc build (after this\n> patch) are within the scope of an appropriate declaration, so there is\n> no *need* to include <io.h> in either mingw.h or msvc.h.\n> [I'm confident the same is true of the MinGW build as well, but I didn't\n> have time to check before sending this mail...]\n>\n> I suspect that you already know this and I'm just being dumb in missing\n> the import of your question... Perhaps you could clarify your concerns\n> regarding this patch?\n>\n\nActually, I suspect that you know exactly what my concern is (based on\nthe above), and that it's not with your patch.\n\nI have a patch in my MSVC-tree that includes io.h in mingw.h, because\nmingw.h already depends on facilities from io.h on MSVC. My point was\nsimply that this dependency was already present, and as such I think\nmingw.h is the appropriate place to include it.\n\nYour patch might remove the warnings (perhaps it was only msvc.c that\ndepends on io.h, I don't remember), and that's fine. But I think we\nshould solve the problem in msvc.[ch] instread, as this is the\ncompatibility-layer that the rest of the system includes.\n\nBut it's just an opinion, deal with it as you please. The most\nimportant part is to prevent warnings/errors, how we do it is\nsecondary.\n"},{"id":"158800","messageId":"4D1F8DDA.1030303@ramsay1.demon.co.uk","threadId":"26130","inReplyTo":"AANLkTinAAGWeFDomo-NQrVtrdf9ue1xVxufy+bkWz1Fc@mail.gmail.com","subject":"Re: [PATCH] msvc: Fix compilation error due to missing mktemp() declaration","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-01-01T20:26:02Z","receivedAt":"2011-01-01T20:26:02Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Erik Faye-Lund wrote:\n> Actually, I suspect that you know exactly what my concern is (based on\n> the above), and that it's not with your patch.\n\nActually no, which is why I asked! :-D\n\n> I have a patch in my MSVC-tree that includes io.h in mingw.h, because\n> mingw.h already depends on facilities from io.h on MSVC. My point was\n> simply that this dependency was already present, and as such I think\n> mingw.h is the appropriate place to include it.\n\nOK, v2 of patch on the way...\n\nATB,\nRamsay Jones\n"}]}