From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Junio C Hamano <gitster@pobox.com>,
GIT Mailing-list <git@vger.kernel.org>,
sschuberth@gmail.com
Subject: Re: [PATCH 04/14] msvc: Fix macro redefinition warnings
Date: Wed, 08 Dec 2010 00:05:12 +0000 [thread overview]
Message-ID: <4CFECBB8.2070900@ramsay1.demon.co.uk> (raw)
In-Reply-To: <201012042204.52002.j6t@kdbg.org>
Johannes Sixt wrote:
> On Samstag, 4. Dezember 2010, Ramsay Jones wrote:
>> --- a/compat/mingw.h
>> +++ b/compat/mingw.h
>> @@ -14,12 +14,6 @@ typedef int socklen_t;
>> #define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK)
>> #define S_ISSOCK(x) 0
>>
>> -#ifndef _STAT_H_
>
> Instead of removing the macros, wouldn't we be much safer with just
>
> #ifndef S_IWUSR
>
> ? ...
Er... no.
Commit 4091bfc (which added these macros) does not provide any motivation
for the change, and I'm having a hard time trying to imagine a useful
purpose for this part of the commit. (I'm not saying there isn't one - just
that I can't see it :-P )
On MinGW, the <sys/stat.h> header is always included prior to this header,
so the _STAT_H_ include guard is always defined, so these macros will
never be defined (which is a *good* thing; have you looked at the definitions).
Trying to use compat/mingw.h without having first included <sys/stat.h> is
not going to work!
Also, note that the include guard for the msvc <sys/stat.h> file is _INC_STAT.
So, on msvc, including <sys/stat.h> does not suppress these macro definitions
(Not that it actually matters here, because it doesn't define these symbols
anyway!). Which is why msvc issues these macro redefinition warnings (they
conflict with the definitions in compat/vcbuild/include/unistd.h). We most
definitely don't want to use the macros in compat/mingw.h on msvc. (They are
positively *wrong*)
[Hmmm, I've just noticed that the msvc compat header is missing a definition of
the _S_IRWXU macro!]
So, once again, I see no reason to keep them ... Unless you know otherwise.
ATB,
Ramsay Jones
next prev parent reply other threads:[~2010-12-08 0:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-04 19:00 [PATCH 04/14] msvc: Fix macro redefinition warnings Ramsay Jones
2010-12-04 21:04 ` Johannes Sixt
2010-12-08 0:05 ` Ramsay Jones [this message]
2010-12-08 10:32 ` Sebastian Schuberth
2010-12-08 19:51 ` Johannes Sixt
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=4CFECBB8.2070900@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=sschuberth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.