{"thread":{"id":"21022","subject":"[PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","startedAt":"2009-09-22T04:10:18Z","lastAt":"2009-09-28T10:21:57Z","messageCount":13,"participants":["Michael Wookey","Johannes Sixt","Marius Storm-Olsen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"123611","messageId":"d2e97e800909212110w423e3b2fm85ac6f76439e0591@mail.gmail.com","threadId":"21022","inReplyTo":null,"subject":"[PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Michael Wookey","fromEmail":"michaelwookey@gmail.com","sentAt":"2009-09-22T04:10:18Z","receivedAt":"2009-09-22T04:10:18Z","isPatch":true,"sender":{"key":"michaelwookey@gmail.com","avatar":"https://avatars.githubusercontent.com/u/19476?v=4"},"body":"MSVC builds define UNICODE which results in the \"WIDE\" variation of\nWin32 API's being used.\n\nExplicitly use the ANSI variation of the API's for compatibility with\nmsysgit.\n\nSigned-off-by: Michael Wookey <michaelwookey@gmail.com>\n---\n compat/mingw.c |   26 +++++++++++++-------------\n 1 files changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 6b5b5b2..39be42f 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -135,7 +135,7 @@ int mingw_open (const char *filename, int oflags, ...)\n \tfd = open(filename, oflags, mode);\n\n \tif (fd < 0 && (oflags & O_CREAT) && errno == EACCES) {\n-\t\tDWORD attrs = GetFileAttributes(filename);\n+\t\tDWORD attrs = GetFileAttributesA(filename);\n \t\tif (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))\n \t\t\terrno = EISDIR;\n \t}\n@@ -607,7 +607,7 @@ static char *lookup_prog(const char *dir, const\nchar *cmd, int isexe, int exe_on\n \t\treturn xstrdup(path);\n \tpath[strlen(path)-4] = '\\0';\n \tif ((!exe_only || isexe) && access(path, F_OK) == 0)\n-\t\tif (!(GetFileAttributes(path) & FILE_ATTRIBUTE_DIRECTORY))\n+\t\tif (!(GetFileAttributesA(path) & FILE_ATTRIBUTE_DIRECTORY))\n \t\t\treturn xstrdup(path);\n \treturn NULL;\n }\n@@ -641,14 +641,14 @@ static int env_compare(const void *a, const void *b)\n static pid_t mingw_spawnve(const char *cmd, const char **argv, char **env,\n \t\t\t   int prepend_cmd)\n {\n-\tSTARTUPINFO si;\n+\tSTARTUPINFOA si;\n \tPROCESS_INFORMATION pi;\n \tstruct strbuf envblk, args;\n \tunsigned flags;\n \tBOOL ret;\n\n \t/* Determine whether or not we are associated to a console */\n-\tHANDLE cons = CreateFile(\"CONOUT$\", GENERIC_WRITE,\n+\tHANDLE cons = CreateFileA(\"CONOUT$\", GENERIC_WRITE,\n \t\t\tFILE_SHARE_WRITE, NULL, OPEN_EXISTING,\n \t\t\tFILE_ATTRIBUTE_NORMAL, NULL);\n \tif (cons == INVALID_HANDLE_VALUE) {\n@@ -717,7 +717,7 @@ static pid_t mingw_spawnve(const char *cmd, const\nchar **argv, char **env,\n \t}\n\n \tmemset(&pi, 0, sizeof(pi));\n-\tret = CreateProcess(cmd, args.buf, NULL, NULL, TRUE, flags,\n+\tret = CreateProcessA(cmd, args.buf, NULL, NULL, TRUE, flags,\n \t\tenv ? envblk.buf : NULL, NULL, &si, &pi);\n\n \tif (env)\n@@ -965,23 +965,23 @@ int mingw_rename(const char *pold, const char *pnew)\n \tif (errno != EEXIST)\n \t\treturn -1;\n repeat:\n-\tif (MoveFileEx(pold, pnew, MOVEFILE_REPLACE_EXISTING))\n+\tif (MoveFileExA(pold, pnew, MOVEFILE_REPLACE_EXISTING))\n \t\treturn 0;\n \t/* TODO: translate more errors */\n \tgle = GetLastError();\n \tif (gle == ERROR_ACCESS_DENIED &&\n-\t    (attrs = GetFileAttributes(pnew)) != INVALID_FILE_ATTRIBUTES) {\n+\t    (attrs = GetFileAttributesA(pnew)) != INVALID_FILE_ATTRIBUTES) {\n \t\tif (attrs & FILE_ATTRIBUTE_DIRECTORY) {\n \t\t\terrno = EISDIR;\n \t\t\treturn -1;\n \t\t}\n \t\tif ((attrs & FILE_ATTRIBUTE_READONLY) &&\n-\t\t    SetFileAttributes(pnew, attrs & ~FILE_ATTRIBUTE_READONLY)) {\n-\t\t\tif (MoveFileEx(pold, pnew, MOVEFILE_REPLACE_EXISTING))\n+\t\t    SetFileAttributesA(pnew, attrs & ~FILE_ATTRIBUTE_READONLY)) {\n+\t\t\tif (MoveFileExA(pold, pnew, MOVEFILE_REPLACE_EXISTING))\n \t\t\t\treturn 0;\n \t\t\tgle = GetLastError();\n \t\t\t/* revert file attributes on failure */\n-\t\t\tSetFileAttributes(pnew, attrs);\n+\t\t\tSetFileAttributesA(pnew, attrs);\n \t\t}\n \t}\n \tif (tries < ARRAY_SIZE(delay) && gle == ERROR_ACCESS_DENIED) {\n@@ -1006,7 +1006,7 @@ struct passwd *getpwuid(int uid)\n \tstatic struct passwd p;\n\n \tDWORD len = sizeof(user_name);\n-\tif (!GetUserName(user_name, &len))\n+\tif (!GetUserNameA(user_name, &len))\n \t\treturn NULL;\n \tp.pw_name = user_name;\n \tp.pw_gecos = \"unknown\";\n@@ -1151,7 +1151,7 @@ void mingw_open_html(const char *unixpath)\n {\n \tconst char *htmlpath = make_backslash_path(unixpath);\n \tprintf(\"Launching default browser to display HTML ...\\n\");\n-\tShellExecute(NULL, \"open\", htmlpath, NULL, \"\\\\\", 0);\n+\tShellExecuteA(NULL, \"open\", htmlpath, NULL, \"\\\\\", 0);\n }\n\n int link(const char *oldpath, const char *newpath)\n@@ -1160,7 +1160,7 @@ int link(const char *oldpath, const char *newpath)\n \tstatic T create_hard_link = NULL;\n \tif (!create_hard_link) {\n \t\tcreate_hard_link = (T) GetProcAddress(\n-\t\t\tGetModuleHandle(\"kernel32.dll\"), \"CreateHardLinkA\");\n+\t\t\tGetModuleHandleA(\"kernel32.dll\"), \"CreateHardLinkA\");\n \t\tif (!create_hard_link)\n \t\t\tcreate_hard_link = (T)-1;\n \t}\n-- \n1.6.5.rc1.44.ga1675\n"},{"id":"123612","messageId":"4AB869EE.1020200@viscovery.net","threadId":"21022","inReplyTo":"d2e97e800909212110w423e3b2fm85ac6f76439e0591@mail.gmail.com","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-09-22T06:08:46Z","receivedAt":"2009-09-22T06:08:46Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Michael Wookey schrieb:\n> MSVC builds define UNICODE which results in the \"WIDE\" variation of\n> Win32 API's being used.\n> \n> Explicitly use the ANSI variation of the API's for compatibility with\n> msysgit.\n> \n> Signed-off-by: Michael Wookey <michaelwookey@gmail.com>\n\nMarius,\n\nI would like to understand why you did not have this issue.\n\nThe patch itself looks fine.\n\n-- Hannes\n"},{"id":"123615","messageId":"4AB87B6B.1070808@gmail.com","threadId":"21022","inReplyTo":"4AB869EE.1020200@viscovery.net","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Marius Storm-Olsen","fromEmail":"mstormo@gmail.com","sentAt":"2009-09-22T07:23:23Z","receivedAt":"2009-09-22T07:23:23Z","isPatch":true,"sender":{"key":"mstormo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1500?v=4"},"body":"Johannes Sixt said the following on 22.09.2009 08:08:\n> Michael Wookey schrieb:\n>> MSVC builds define UNICODE which results in the \"WIDE\" variation of\n>> Win32 API's being used.\n>>\n>> Explicitly use the ANSI variation of the API's for compatibility with\n>> msysgit.\n>>\n>> Signed-off-by: Michael Wookey <michaelwookey@gmail.com>\n> \n> Marius,\n> \n> I would like to understand why you did not have this issue.\n> \n> The patch itself looks fine.\n\nI never added the UNICODE define to the Git compile\nprocess with MSVC (Check the Makefile), so then the\nwindows API should use the ANSI version by default.\nAnd the following patch proved my point (sorry, will\nprobably wrap):\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -1201,6 +1201,12 @@ struct mingw_DIR\n        char                    dd_name[1];     /* given path for dir with search pattern (struct is extended) */\n };\n\n+#ifdef UNICODE\n+#pragma message(\"We have UNICODE defined\")\n+#else\n+#pragma message(\"Nope, UNICODE is not defined here\")\n+#endif\n+\n struct dirent *mingw_readdir(DIR *dir)\n {\n        WIN32_FIND_DATAA buf;\n\n\n> make MSVC=1\n    CC compat/msvc.o\nmsvc.c\nd:\\msvc\\git\\compat\\mingw.c(223) : warning C4133: 'function' : incompatible types - from '_stati64 *' to '_stat64 *'\nd:\\msvc\\git\\compat\\mingw.c(636) : warning C4090: 'initializing' : different 'const' qualifiers\nd:\\msvc\\git\\compat\\mingw.c(637) : warning C4090: 'initializing' : different 'const' qualifiers\nd:\\msvc\\git\\compat\\mingw.c(787) : warning C4090: 'function' : different 'const' qualifiers\nd:\\msvc\\git\\compat\\mingw.c(797) : warning C4090: 'function' : different 'const' qualifiers\nNope, UNICODE is not defined here\n    AR libgit.a\nMicrosoft (R) Library Manager Version 9.00.21022.08\nCopyright (C) Microsoft Corporation.  All rights reserved.\n\nMichael, how are you trying to compile git? With the IDE or\nthe GNU Make? Which version of MSVC? If you use the IDE, can\nyou make sure it doesn't contain the UNICODE define in the\ncompiler section of the properties of the projects?\n\nIn general though, I'm ok with patches which specifies the\ncorrect API, so we won't have the problem, should we decide\nto add UNICODE in the future.\n\n--\n.marius\n"},{"id":"123618","messageId":"d2e97e800909220217y5bda4698pc286711a3535f87d@mail.gmail.com","threadId":"21022","inReplyTo":"4AB87B6B.1070808@gmail.com","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Michael Wookey","fromEmail":"michaelwookey@gmail.com","sentAt":"2009-09-22T09:17:25Z","receivedAt":"2009-09-22T09:17:25Z","isPatch":true,"sender":{"key":"michaelwookey@gmail.com","avatar":"https://avatars.githubusercontent.com/u/19476?v=4"},"body":"2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n> Michael, how are you trying to compile git? With the IDE or\n> the GNU Make? Which version of MSVC? If you use the IDE, can\n> you make sure it doesn't contain the UNICODE define in the\n> compiler section of the properties of the projects?\n\nI'm using the VS 2008 Professional IDE (the solution doesn't open in\nVS 2005). I made no changes to the build settings. In the Preprocessor\nsection of the project, UNICODE is defined.\n\nOn another note, I see *many* build warnings for things like\n\"signed/unsigned compares\". I'd be willing to work through these\nwarnings and fix them. Thoughts?\n"},{"id":"123619","messageId":"4AB89B7F.3050902@gmail.com","threadId":"21022","inReplyTo":"d2e97e800909220217y5bda4698pc286711a3535f87d@mail.gmail.com","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Marius Storm-Olsen","fromEmail":"mstormo@gmail.com","sentAt":"2009-09-22T09:40:15Z","receivedAt":"2009-09-22T09:40:15Z","isPatch":true,"sender":{"key":"mstormo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1500?v=4"},"body":"Michael Wookey said the following on 22.09.2009 11:17:\n> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>> Michael, how are you trying to compile git? With the IDE or the\n>> GNU Make? Which version of MSVC? If you use the IDE, can you make\n>> sure it doesn't contain the UNICODE define in the compiler\n>> section of the properties of the projects?\n> \n> I'm using the VS 2008 Professional IDE (the solution doesn't open\n> in VS 2005). I made no changes to the build settings. In the\n> Preprocessor section of the project, UNICODE is defined.\n\nWere these projects generated with the Vcproj generator in \ncontrib/buildsystem, with the Qmake generator, or the projects from \nFrank's repo?\n\n\n> On another note, I see *many* build warnings for things like \n> \"signed/unsigned compares\". I'd be willing to work through these \n> warnings and fix them. Thoughts?\n\nWell, first find out why these are a problem with MSVC and not GCC. \nAre the types different on these platforms? signed vs unsigned should \nshow up with GCC as well. We need to make sure that we don't fix \nsigned/unsigned issues on one platform, just to introduce it to \nanother platform.\nIn any case, it would be good for someone to have a look at these, \njust so we can determine the cause for most of them, and then we \nshould figure out on the list how to deal with them.\n\nJust my €0.2..\n\n--\n.marius\n"},{"id":"123620","messageId":"d2e97e800909220254sc677abeia220c19f6ef5bd28@mail.gmail.com","threadId":"21022","inReplyTo":"4AB89B7F.3050902@gmail.com","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Michael Wookey","fromEmail":"michaelwookey@gmail.com","sentAt":"2009-09-22T09:54:34Z","receivedAt":"2009-09-22T09:54:34Z","isPatch":true,"sender":{"key":"michaelwookey@gmail.com","avatar":"https://avatars.githubusercontent.com/u/19476?v=4"},"body":"2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n> Michael Wookey said the following on 22.09.2009 11:17:\n>>\n>> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>>>\n>>> Michael, how are you trying to compile git? With the IDE or the\n>>> GNU Make? Which version of MSVC? If you use the IDE, can you make\n>>> sure it doesn't contain the UNICODE define in the compiler\n>>> section of the properties of the projects?\n>>\n>> I'm using the VS 2008 Professional IDE (the solution doesn't open\n>> in VS 2005). I made no changes to the build settings. In the\n>> Preprocessor section of the project, UNICODE is defined.\n>\n> Were these projects generated with the Vcproj generator in\n> contrib/buildsystem, with the Qmake generator, or the projects from Frank's\n> repo?\n\nThe project was generated from the vcproj generator in\ncontrib/buildsystem from git.git/master.\n\n>> On another note, I see *many* build warnings for things like\n>> \"signed/unsigned compares\". I'd be willing to work through these warnings\n>> and fix them. Thoughts?\n>\n> Well, first find out why these are a problem with MSVC and not GCC. Are the\n> types different on these platforms? signed vs unsigned should show up with\n> GCC as well. We need to make sure that we don't fix signed/unsigned issues\n> on one platform, just to introduce it to another platform.\n> In any case, it would be good for someone to have a look at these, just so\n> we can determine the cause for most of them, and then we should figure out\n> on the list how to deal with them.\n\nWell, at warning level 4, MSVC is quite verbose. Perhaps the current\ngcc build flags are more forgiving?\n"},{"id":"123659","messageId":"d2e97e800909222143y2cb3b37bq7f6d018c06934ab8@mail.gmail.com","threadId":"21022","inReplyTo":"d2e97e800909220254sc677abeia220c19f6ef5bd28@mail.gmail.com","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Michael Wookey","fromEmail":"michaelwookey@gmail.com","sentAt":"2009-09-23T04:43:31Z","receivedAt":"2009-09-23T04:43:31Z","isPatch":true,"sender":{"key":"michaelwookey@gmail.com","avatar":"https://avatars.githubusercontent.com/u/19476?v=4"},"body":"2009/9/22 Michael Wookey <michaelwookey@gmail.com>:\n> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>>> On another note, I see *many* build warnings for things like\n>>> \"signed/unsigned compares\". I'd be willing to work through these warnings\n>>> and fix them. Thoughts?\n>>\n>> Well, first find out why these are a problem with MSVC and not GCC. Are the\n>> types different on these platforms? signed vs unsigned should show up with\n>> GCC as well. We need to make sure that we don't fix signed/unsigned issues\n>> on one platform, just to introduce it to another platform.\n>> In any case, it would be good for someone to have a look at these, just so\n>> we can determine the cause for most of them, and then we should figure out\n>> on the list how to deal with them.\n>\n> Well, at warning level 4, MSVC is quite verbose. Perhaps the current\n> gcc build flags are more forgiving?\n\nAh, gcc does produces similar warnings when \"-Wextra\" is added to the CFLAGS:\n\n  CFLAGS = -g -O2 -Wall -Wextra\n\nIMHO, warnings such as these should be worked through and fixed, or\nthere may be some latent bug waiting to appear.\n"},{"id":"123918","messageId":"4AC05BA5.4050106@viscovery.net","threadId":"21022","inReplyTo":"d2e97e800909220254sc677abeia220c19f6ef5bd28@mail.gmail.com","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-09-28T06:45:57Z","receivedAt":"2009-09-28T06:45:57Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Michael Wookey schrieb:\n> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>> Michael Wookey said the following on 22.09.2009 11:17:\n>>> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>>>> Michael, how are you trying to compile git? With the IDE or the\n>>>> GNU Make? Which version of MSVC? If you use the IDE, can you make\n>>>> sure it doesn't contain the UNICODE define in the compiler\n>>>> section of the properties of the projects?\n>>> I'm using the VS 2008 Professional IDE (the solution doesn't open\n>>> in VS 2005). I made no changes to the build settings. In the\n>>> Preprocessor section of the project, UNICODE is defined.\n>> Were these projects generated with the Vcproj generator in\n>> contrib/buildsystem, with the Qmake generator, or the projects from Frank's\n>> repo?\n> \n> The project was generated from the vcproj generator in\n> contrib/buildsystem from git.git/master.\n\nWhat's the status of this? Do Sebastian Schuberth's patches\n\nhttp://article.gmane.org/gmane.comp.version-control.msysgit/7152\nhttp://article.gmane.org/gmane.comp.version-control.msysgit/7153\n\nmake a difference?\n\n-- Hannes\n"},{"id":"123922","messageId":"d2e97e800909280047l5da52ffdxd86589cda4542f46@mail.gmail.com","threadId":"21022","inReplyTo":"4AC05BA5.4050106@viscovery.net","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Michael Wookey","fromEmail":"michaelwookey@gmail.com","sentAt":"2009-09-28T07:47:08Z","receivedAt":"2009-09-28T07:47:08Z","isPatch":true,"sender":{"key":"michaelwookey@gmail.com","avatar":"https://avatars.githubusercontent.com/u/19476?v=4"},"body":"2009/9/28 Johannes Sixt <j.sixt@viscovery.net>:\n> Michael Wookey schrieb:\n>> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>>> Michael Wookey said the following on 22.09.2009 11:17:\n>>>> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>>>>> Michael, how are you trying to compile git? With the IDE or the\n>>>>> GNU Make? Which version of MSVC? If you use the IDE, can you make\n>>>>> sure it doesn't contain the UNICODE define in the compiler\n>>>>> section of the properties of the projects?\n>>>> I'm using the VS 2008 Professional IDE (the solution doesn't open\n>>>> in VS 2005). I made no changes to the build settings. In the\n>>>> Preprocessor section of the project, UNICODE is defined.\n>>> Were these projects generated with the Vcproj generator in\n>>> contrib/buildsystem, with the Qmake generator, or the projects from Frank's\n>>> repo?\n>>\n>> The project was generated from the vcproj generator in\n>> contrib/buildsystem from git.git/master.\n>\n> What's the status of this?\n\nI was hoping that this gets included into git.git because it fixes a\nreal issue with MSVC builds. Since Junio is away, perhaps Shawn can\ntake the patch into his interim tree?\n\nBTW - would you mind giving this patch an ack?\n\n> Do Sebastian Schuberth's patches\n> http://article.gmane.org/gmane.comp.version-control.msysgit/7152\n> http://article.gmane.org/gmane.comp.version-control.msysgit/7153\n>\n> make a difference?\n\nUnfortunately, no. Those patches do not make a difference.\n"},{"id":"123923","messageId":"4AC06F65.1020301@viscovery.net","threadId":"21022","inReplyTo":"d2e97e800909280047l5da52ffdxd86589cda4542f46@mail.gmail.com","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-09-28T08:10:13Z","receivedAt":"2009-09-28T08:10:13Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Michael Wookey schrieb:\n> 2009/9/28 Johannes Sixt <j.sixt@viscovery.net>:\n>> Michael Wookey schrieb:\n>>> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>>>> Michael Wookey said the following on 22.09.2009 11:17:\n>>>>> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>>>>>> Michael, how are you trying to compile git? With the IDE or the\n>>>>>> GNU Make? Which version of MSVC? If you use the IDE, can you make\n>>>>>> sure it doesn't contain the UNICODE define in the compiler\n>>>>>> section of the properties of the projects?\n>>>>> I'm using the VS 2008 Professional IDE (the solution doesn't open\n>>>>> in VS 2005). I made no changes to the build settings. In the\n>>>>> Preprocessor section of the project, UNICODE is defined.\n>>>> Were these projects generated with the Vcproj generator in\n>>>> contrib/buildsystem, with the Qmake generator, or the projects from Frank's\n>>>> repo?\n>>> The project was generated from the vcproj generator in\n>>> contrib/buildsystem from git.git/master.\n>> What's the status of this?\n> \n> I was hoping that this gets included into git.git because it fixes a\n> real issue with MSVC builds. Since Junio is away, perhaps Shawn can\n> take the patch into his interim tree?\n> \n> BTW - would you mind giving this patch an ack?\n\nAs I said, the patch looks fine. However, in the commit message you say:\n\n  MSVC builds define UNICODE which results in the \"WIDE\" variation of\n  Win32 API's being used.\n\nBut since Marius has built the code without your patch, this justification\nmust be incomplete. I won't give a formal Ack until this is clarified.\n\nPlease work with Marius to figure out why your build uses UNICODE while\nMarius's doesn't.\n\n-- Hannes\n"},{"id":"123929","messageId":"d2e97e800909280250j4e432deeo230cbc622b6e690a@mail.gmail.com","threadId":"21022","inReplyTo":"4AC06F65.1020301@viscovery.net","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Michael Wookey","fromEmail":"michaelwookey@gmail.com","sentAt":"2009-09-28T09:50:18Z","receivedAt":"2009-09-28T09:50:18Z","isPatch":true,"sender":{"key":"michaelwookey@gmail.com","avatar":"https://avatars.githubusercontent.com/u/19476?v=4"},"body":"2009/9/28 Johannes Sixt <j.sixt@viscovery.net>:\n> Michael Wookey schrieb:\n>> 2009/9/28 Johannes Sixt <j.sixt@viscovery.net>:\n>>> Michael Wookey schrieb:\n>>>> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>>>>> Michael Wookey said the following on 22.09.2009 11:17:\n>>>>>> 2009/9/22 Marius Storm-Olsen <mstormo@gmail.com>:\n>>>>>>> Michael, how are you trying to compile git? With the IDE or the\n>>>>>>> GNU Make? Which version of MSVC? If you use the IDE, can you make\n>>>>>>> sure it doesn't contain the UNICODE define in the compiler\n>>>>>>> section of the properties of the projects?\n>>>>>> I'm using the VS 2008 Professional IDE (the solution doesn't open\n>>>>>> in VS 2005). I made no changes to the build settings. In the\n>>>>>> Preprocessor section of the project, UNICODE is defined.\n>>>>> Were these projects generated with the Vcproj generator in\n>>>>> contrib/buildsystem, with the Qmake generator, or the projects from Frank's\n>>>>> repo?\n>>>> The project was generated from the vcproj generator in\n>>>> contrib/buildsystem from git.git/master.\n>>> What's the status of this?\n>>\n>> I was hoping that this gets included into git.git because it fixes a\n>> real issue with MSVC builds. Since Junio is away, perhaps Shawn can\n>> take the patch into his interim tree?\n>>\n>> BTW - would you mind giving this patch an ack?\n>\n> As I said, the patch looks fine. However, in the commit message you say:\n>\n>  MSVC builds define UNICODE which results in the \"WIDE\" variation of\n>  Win32 API's being used.\n>\n> But since Marius has built the code without your patch, this justification\n> must be incomplete. I won't give a formal Ack until this is clarified.\n>\n> Please work with Marius to figure out why your build uses UNICODE while\n> Marius's doesn't.\n\nWell, the command line builds have always worked fine. The definition\nof UNICODE was limited to building in the IDE. That detail was\nunfortunately missing from the original commit message.\n\nIt seems that the project file that is generated by Vcproj.pm\n(inadvertently?) defines UNICODE. Perhaps the patch below is better\nthan my original workaround. If you think so, I'll create a formal\npatch.\n\n[ sorry if the patch wraps ]\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm\nb/contrib/buildsystems/Generators/Vcproj.pm\nindex 00ec0c1..a648756 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -173,7 +173,7 @@ sub createLibProject {\n                                Optimization=\"0\"\n                                InlineFunctionExpansion=\"1\"\n                                AdditionalIncludeDirectories=\"$includes\"\n-\nPreprocessorDefinitions=\"UNICODE,WIN32,_DEBUG,$defines\"\n+                               PreprocessorDefinitions=\"WIN32,_DEBUG,$defines\"\n                                MinimalRebuild=\"true\"\n                                RuntimeLibrary=\"1\"\n                                UsePrecompiledHeader=\"0\"\n"},{"id":"123931","messageId":"d2e97e800909280255h70e4c006m98cde895b95fef29@mail.gmail.com","threadId":"21022","inReplyTo":"d2e97e800909280250j4e432deeo230cbc622b6e690a@mail.gmail.com","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Michael Wookey","fromEmail":"michaelwookey@gmail.com","sentAt":"2009-09-28T09:55:06Z","receivedAt":"2009-09-28T09:55:06Z","isPatch":true,"sender":{"key":"michaelwookey@gmail.com","avatar":"https://avatars.githubusercontent.com/u/19476?v=4"},"body":"> It seems that the project file that is generated by Vcproj.pm\n> (inadvertently?) defines UNICODE. Perhaps the patch below is better\n> than my original workaround. If you think so, I'll create a formal\n> patch.\n>\n> [ sorry if the patch wraps ]\n>\n\nscrub the previous patch... there were more instances of UNICODE\ndefined (for release and debug builds). The patch below takes care of\nthem all.\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm\nb/contrib/buildsystems/Generators/Vcproj.pm\nindex 00ec0c1..a215911 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -173,7 +173,7 @@ sub createLibProject {\n                                Optimization=\"0\"\n                                InlineFunctionExpansion=\"1\"\n                                AdditionalIncludeDirectories=\"$includes\"\n-\nPreprocessorDefinitions=\"UNICODE,WIN32,_DEBUG,$defines\"\n+                               PreprocessorDefinitions=\"WIN32,_DEBUG,$defines\"\n                                MinimalRebuild=\"true\"\n                                RuntimeLibrary=\"1\"\n                                UsePrecompiledHeader=\"0\"\n@@ -239,7 +239,7 @@ sub createLibProject {\n                                InlineFunctionExpansion=\"1\"\n                                EnableIntrinsicFunctions=\"true\"\n                                AdditionalIncludeDirectories=\"$includes\"\n-\nPreprocessorDefinitions=\"UNICODE,WIN32,NDEBUG,$defines\"\n+                               PreprocessorDefinitions=\"WIN32,NDEBUG,$defines\"\n                                RuntimeLibrary=\"0\"\n                                EnableFunctionLevelLinking=\"true\"\n                                UsePrecompiledHeader=\"0\"\n@@ -395,7 +395,7 @@ sub createAppProject {\n                                Optimization=\"0\"\n                                InlineFunctionExpansion=\"1\"\n                                AdditionalIncludeDirectories=\"$includes\"\n-\nPreprocessorDefinitions=\"UNICODE,WIN32,_DEBUG,$defines\"\n+                               PreprocessorDefinitions=\"WIN32,_DEBUG,$defines\"\n                                MinimalRebuild=\"true\"\n                                RuntimeLibrary=\"1\"\n                                UsePrecompiledHeader=\"0\"\n@@ -466,7 +466,7 @@ sub createAppProject {\n                                InlineFunctionExpansion=\"1\"\n                                EnableIntrinsicFunctions=\"true\"\n                                AdditionalIncludeDirectories=\"$includes\"\n-\nPreprocessorDefinitions=\"UNICODE,WIN32,NDEBUG,$defines\"\n+                               PreprocessorDefinitions=\"WIN32,NDEBUG,$defines\"\n                                RuntimeLibrary=\"0\"\n"},{"id":"123934","messageId":"4AC08E45.8010707@gmail.com","threadId":"21022","inReplyTo":"d2e97e800909280255h70e4c006m98cde895b95fef29@mail.gmail.com","subject":"Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's","fromName":"Marius Storm-Olsen","fromEmail":"mstormo@gmail.com","sentAt":"2009-09-28T10:21:57Z","receivedAt":"2009-09-28T10:21:57Z","isPatch":true,"sender":{"key":"mstormo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1500?v=4"},"body":"Michael Wookey said the following on 28.09.2009 11:55:\n>> It seems that the project file that is generated by Vcproj.pm\n>> (inadvertently?) defines UNICODE. Perhaps the patch below is better\n>> than my original workaround. If you think so, I'll create a formal\n>> patch.\n>>\n>> [ sorry if the patch wraps ]\n>>\n> \n> scrub the previous patch... there were more instances of UNICODE\n> defined (for release and debug builds). The patch below takes care of\n> them all.\n\nYup, IMO this is the correct patch, since it will follow the Makefile \nmore closely. So, if we then decide to add UNICODE in the Makefile, \nthe generated files will follow.\n\nMake it into a proper patch, and I'll ack.\n\n--\n.marius\n"}]}