From c4eafc728d0b4ce5015cdf7f484a3c6f8ef4adb8 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 30 Nov 2020 23:16:20 -0600 Subject: [PATCH] chore(string): add windows support to SStrCmpI --- storm/String.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/storm/String.cpp b/storm/String.cpp index 179da04..89b41d9 100644 --- a/storm/String.cpp +++ b/storm/String.cpp @@ -7,7 +7,14 @@ #include #include #include + +#if defined(WHOA_PLATFORM_WIN) +#include +#endif + +#if defined(WHOA_PLATFORM_MAC) || defined(WHOA_PLATFORM_LINUX) #include +#endif uint8_t bytesFromUTF8[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -236,7 +243,13 @@ int32_t SStrCmp(const char* string1, const char* string2, size_t maxchars) { } int32_t SStrCmpI(const char* string1, const char* string2, size_t maxchars) { +#if defined(WHOA_PLATFORM_WIN) + return _strnicmp(string1, string2, maxchars); +#endif + +#if defined(WHOA_PLATFORM_MAC) || defined(WHOA_PLATFORM_LINUX) return strncasecmp(string1, string2, maxchars); +#endif } size_t SStrCopy(char* dest, const char* source, size_t destsize) {