MSVC util/StringAPI.hxx add usage of MSVC compiler

This commit is contained in:
August2111 2021-07-23 05:49:12 +02:00 committed by Max Kellermann
parent c30466b84a
commit 1ff8626716

View File

@ -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]]