From: Marius Storm-Olsen <mstormo@gmail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Michael Wookey <michaelwookey@gmail.com>,
Marius Storm-Olsen <mstormo@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's
Date: Tue, 22 Sep 2009 09:23:23 +0200 [thread overview]
Message-ID: <4AB87B6B.1070808@gmail.com> (raw)
In-Reply-To: <4AB869EE.1020200@viscovery.net>
Johannes Sixt said the following on 22.09.2009 08:08:
> Michael Wookey schrieb:
>> MSVC builds define UNICODE which results in the "WIDE" variation of
>> Win32 API's being used.
>>
>> Explicitly use the ANSI variation of the API's for compatibility with
>> msysgit.
>>
>> Signed-off-by: Michael Wookey <michaelwookey@gmail.com>
>
> Marius,
>
> I would like to understand why you did not have this issue.
>
> The patch itself looks fine.
I never added the UNICODE define to the Git compile
process with MSVC (Check the Makefile), so then the
windows API should use the ANSI version by default.
And the following patch proved my point (sorry, will
probably wrap):
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1201,6 +1201,12 @@ struct mingw_DIR
char dd_name[1]; /* given path for dir with search pattern (struct is extended) */
};
+#ifdef UNICODE
+#pragma message("We have UNICODE defined")
+#else
+#pragma message("Nope, UNICODE is not defined here")
+#endif
+
struct dirent *mingw_readdir(DIR *dir)
{
WIN32_FIND_DATAA buf;
> make MSVC=1
CC compat/msvc.o
msvc.c
d:\msvc\git\compat\mingw.c(223) : warning C4133: 'function' : incompatible types - from '_stati64 *' to '_stat64 *'
d:\msvc\git\compat\mingw.c(636) : warning C4090: 'initializing' : different 'const' qualifiers
d:\msvc\git\compat\mingw.c(637) : warning C4090: 'initializing' : different 'const' qualifiers
d:\msvc\git\compat\mingw.c(787) : warning C4090: 'function' : different 'const' qualifiers
d:\msvc\git\compat\mingw.c(797) : warning C4090: 'function' : different 'const' qualifiers
Nope, UNICODE is not defined here
AR libgit.a
Microsoft (R) Library Manager Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
Michael, how are you trying to compile git? With the IDE or
the GNU Make? Which version of MSVC? If you use the IDE, can
you make sure it doesn't contain the UNICODE define in the
compiler section of the properties of the projects?
In general though, I'm ok with patches which specifies the
correct API, so we won't have the problem, should we decide
to add UNICODE in the future.
--
.marius
next prev parent reply other threads:[~2009-09-22 7:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-22 4:10 [PATCH] compat/mingw.c: MSVC build must use ANSI Win32 API's Michael Wookey
2009-09-22 6:08 ` Johannes Sixt
2009-09-22 7:23 ` Marius Storm-Olsen [this message]
2009-09-22 9:17 ` Michael Wookey
2009-09-22 9:40 ` Marius Storm-Olsen
2009-09-22 9:54 ` Michael Wookey
2009-09-23 4:43 ` Michael Wookey
2009-09-28 6:45 ` Johannes Sixt
2009-09-28 7:47 ` Michael Wookey
2009-09-28 8:10 ` Johannes Sixt
2009-09-28 9:50 ` Michael Wookey
2009-09-28 9:55 ` Michael Wookey
2009-09-28 10:21 ` Marius Storm-Olsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AB87B6B.1070808@gmail.com \
--to=mstormo@gmail.com \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
--cc=michaelwookey@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).