2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Make plString build on mingw.

This commit is contained in:
Darryl Pogue
2012-02-12 17:19:25 -08:00
parent 5548eb5a6f
commit bdf52410e1
2 changed files with 18 additions and 1 deletions

View File

@ -48,6 +48,23 @@ static inline size_t u16slen(const uint16_t *ustr, size_t max)
}
#endif
/* Provide strnlen and wcsnlen for MinGW which doesn't have them */
#ifdef __MINGW32__
size_t strnlen(const char *s, size_t maxlen)
{
size_t len;
for (len = 0; len < maxlen && *s; len++, s++) { }
return len;
}
size_t wcsnlen(const wchar_t *s, size_t maxlen)
{
size_t len;
for (len = 0; len < maxlen && *s; len++, s++) { }
return len;
}
#endif
#define BADCHAR_REPLACEMENT (0xFFFDul)
void plString::IConvertFromUtf8(const char *utf8, size_t size, bool steal)

View File

@ -121,7 +121,7 @@ class plString
#pragma warning(push)
#pragma warning(disable : 4146)
enum {
kSizeAuto = (size_t)(-2147483648L)
kSizeAuto = (size_t)(-2147483648UL)
};
#pragma warning(pop)