git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] msvc: Directly use MS version (_stricmp) of strcasecmp
@ 2018-11-18 21:02 Sven Strickroth
  2018-11-18 21:58 ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Strickroth @ 2018-11-18 21:02 UTC (permalink / raw)
  To: git; +Cc: gitster, peff, Johannes.Schindelin

This also removes an implicit conversion from size_t (unsigned) to int (signed).

_stricmp as well as _strnicmp are both available since VS2012.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
---
 compat/msvc.h | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/compat/msvc.h b/compat/msvc.h
index 580bb55bf4..ea6527f8b6 100644
--- a/compat/msvc.h
+++ b/compat/msvc.h
@@ -14,13 +14,7 @@
 #define ftruncate    _chsize
 #define strtoull     _strtoui64
 #define strtoll      _strtoi64
-
-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

 #undef ERROR

--
2.19.1.windows.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-20 20:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-18 21:02 [PATCH] msvc: Directly use MS version (_stricmp) of strcasecmp Sven Strickroth
2018-11-18 21:58 ` Jeff King
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

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).