chore(string): add windows support to SStrCmpI

This commit is contained in:
fallenoak 2020-11-30 23:16:20 -06:00
parent 22fd74ec1d
commit c4eafc728d
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D

View file

@ -7,7 +7,14 @@
#include <cstdarg>
#include <cstdio>
#include <cstring>
#if defined(WHOA_PLATFORM_WIN)
#include <string.h>
#endif
#if defined(WHOA_PLATFORM_MAC) || defined(WHOA_PLATFORM_LINUX)
#include <strings.h>
#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) {