1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 11:53:53 +00:00
openmw/libs/platform/string.h

15 lines
398 B
C
Raw Normal View History

// Wrapper for string.h on Mac and MinGW
#ifndef _STRING_WRAPPER_H
#define _STRING_WRAPPER_H
#include <string.h>
#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) || defined(__MINGW32__)
// need our own implementation of strnlen
static size_t strnlen(const char *s, size_t n)
{
const char *p = (const char *)memchr(s, 0, n);
return(p ? p-s : n);
}
#endif
#endif