Hopefully fix build for everyone - someone please work out a way to make the bgfx examples build on platforms with/without the POSIX 2008 strnlen function (nw)

This commit is contained in:
Vas Crabb 2017-01-07 02:12:45 +11:00
parent b2a66f5f5d
commit 189052cd58

View File

@ -7076,8 +7076,7 @@ static const char *ReadString(std::string *s, const char *ptr) {
static bool ReadAttribute(std::string *name, std::string *type,
std::vector<unsigned char> *data, size_t *marker_size,
const char *marker, size_t size) {
using namespace bx;
size_t name_len = strnlen(marker, size);
size_t name_len = bx::strnlen(marker, size);
if (name_len == size) {
// String does not have a terminating character.
return false;
@ -7087,7 +7086,7 @@ static bool ReadAttribute(std::string *name, std::string *type,
marker += name_len + 1;
size -= name_len + 1;
size_t type_len = strnlen(marker, size);
size_t type_len = bx::strnlen(marker, size);
if (type_len == size) {
return false;
}