2011-01-03 14:00:53 +00:00
|
|
|
// Wrapper for string.h on Mac and MinGW
|
2010-09-07 08:40:00 +00:00
|
|
|
#ifndef _STRING_WRAPPER_H
|
|
|
|
#define _STRING_WRAPPER_H
|
|
|
|
|
|
|
|
#include <string.h>
|
2012-02-25 13:43:30 +00:00
|
|
|
#if (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) || defined(__MINGW32__)
|
2010-09-07 08:40:00 +00:00
|
|
|
// 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
|