diff options
author | Sven Strickroth <email@cs-ware.de> | 2018-11-19 16:14:42 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-20 10:57:13 +0900 |
commit | d27525e519310b515b3014cef5920f80930a20ce (patch) | |
tree | 7779fe2efe8d429aca923d663faa2b42e15626bc | |
parent | Git 2.19.1 (diff) | |
download | tgif-d27525e519310b515b3014cef5920f80930a20ce.tar.xz |
msvc: directly use MS version (_stricmp) of strcasecmp
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | compat/msvc.h | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/compat/msvc.h b/compat/msvc.h index 580bb55bf4..29a8ce8204 100644 --- a/compat/msvc.h +++ b/compat/msvc.h @@ -10,18 +10,12 @@ #define inline __inline #define __inline__ __inline #define __attribute__(x) +#define strcasecmp _stricmp #define strncasecmp _strnicmp #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); -} - #undef ERROR #include "compat/mingw.h" |