From: Jeff King <peff@peff.net>
To: Sven Strickroth <email@cs-ware.de>
Cc: git@vger.kernel.org, gitster@pobox.com, Johannes.Schindelin@gmx.de
Subject: Re: [PATCH] msvc: Directly use MS version (_stricmp) of strcasecmp
Date: Sun, 18 Nov 2018 16:58:20 -0500 [thread overview]
Message-ID: <20181118215820.GA14514@sigill.intra.peff.net> (raw)
In-Reply-To: <ad85731f-2c47-f455-c9d3-d47a5fj1e29@cs-ware.de>
On Sun, Nov 18, 2018 at 10:02:02PM +0100, Sven Strickroth wrote:
> This also removes an implicit conversion from size_t (unsigned) to int (signed).
>
> _stricmp as well as _strnicmp are both available since VS2012.
Once upon a time we had problems with taking a function pointer of
strcasecmp (to use as a comparator with string_list), so I wondered if
that might be part of why it's defined the way it is.
But the current definition is already inline:
> -
> -static __inline int strcasecmp (const char *s1, const char *s2)
> -{
> - int size1 = strlen(s1);
> - int sisz2 = strlen(s2);
> - return _strnicmp(s1, s2, sisz2 > size1 ? sisz2 : size1);
> -}
> +#define strcasecmp _stricmp
And it seems we worked around this in de2f95ebed (mailmap: work around
implementations with pure inline strcasecmp, 2013-09-12). So I don't
think there is any blocker there.
(Though of course I have no idea on other portability questions around
_stricmp(); I'll leave that for Windows folks).
-Peff
next prev parent reply other threads:[~2018-11-18 21:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-18 21:02 [PATCH] msvc: Directly use MS version (_stricmp) of strcasecmp Sven Strickroth
2018-11-18 21:58 ` Jeff King [this message]
2018-11-19 2:02 ` Junio C Hamano
2018-11-19 15:14 ` Sven Strickroth
2018-11-20 1:58 ` Junio C Hamano
2018-11-20 20:52 ` Johannes Schindelin
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=20181118215820.GA14514@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=email@cs-ware.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).