1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

Remove no longer required strnlen wrapper

It was used for MinGW & OS X < 10.7. Minimal OS X version was bumped to
10.7 and MinGW support was recently dropped (see
1eaa64c49c).
This commit is contained in:
Nikolay Kasyanov 2015-03-18 23:37:54 +02:00
parent 47bac13749
commit 3e45e9a48a
3 changed files with 2 additions and 36 deletions

View file

@ -5,7 +5,7 @@
#include <cstring> #include <cstring>
#include <stdint.h> #include <stdint.h>
#include <libs/platform/string.h> #include <string.h>
namespace ESM namespace ESM
{ {

View file

@ -2,7 +2,7 @@
#define OPENMW_ESM_READER_H #define OPENMW_ESM_READER_H
#include <stdint.h> #include <stdint.h>
#include <libs/platform/string.h> #include <string.h>
#include <cassert> #include <cassert>
#include <vector> #include <vector>
#include <sstream> #include <sstream>

View file

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