From 1ff8626716f3750b67c82c0999cfc10efbfb417b Mon Sep 17 00:00:00 2001 From: August2111 Date: Fri, 23 Jul 2021 05:49:12 +0200 Subject: [PATCH] MSVC util/StringAPI.hxx add usage of MSVC compiler --- src/util/StringAPI.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/StringAPI.hxx b/src/util/StringAPI.hxx index 4fc31a4e2..3710970e7 100644 --- a/src/util/StringAPI.hxx +++ b/src/util/StringAPI.hxx @@ -184,14 +184,22 @@ StringIsEqual(const char *a, const char *b, size_t length) noexcept static inline bool StringIsEqualIgnoreCase(const char *a, const char *b) noexcept { +#ifdef _MSC_VER + return _stricmp(a, b) == 0; +#else return strcasecmp(a, b) == 0; +#endif } [[gnu::pure]] [[gnu::nonnull]] static inline bool StringIsEqualIgnoreCase(const char *a, const char *b, size_t size) noexcept { +#ifdef _MSC_VER + return _strnicmp(a, b, size) == 0; +#else return strncasecmp(a, b, size) == 0; +#endif } [[gnu::pure]] [[gnu::nonnull]]