mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 21:45:32 +00:00
Cleaned up strnlen in esm_reader. Added -Werror switch to g++.
This commit is contained in:
parent
e30306f7c3
commit
5552c44753
3 changed files with 16 additions and 12 deletions
|
@ -247,7 +247,7 @@ endif (APPLE)
|
|||
|
||||
# Compiler settings
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_definitions (-Wall)
|
||||
add_definitions (-Wall -Werror)
|
||||
endif (CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
# Apple bundling
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
#include <string>
|
||||
#include <libs/platform/stdint.h>
|
||||
#include <libs/platform/string.h>
|
||||
#include <assert.h>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <libs/mangle/stream/stream.hpp>
|
||||
|
@ -15,16 +15,6 @@
|
|||
|
||||
#include <components/to_utf8/to_utf8.hpp>
|
||||
|
||||
#ifdef __APPLE__
|
||||
// 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
|
||||
|
||||
namespace ESM {
|
||||
|
||||
enum Version
|
||||
|
|
14
libs/platform/string.h
Normal file
14
libs/platform/string.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
// Wrapper for string.h on Mac
|
||||
#ifndef _STRING_WRAPPER_H
|
||||
#define _STRING_WRAPPER_H
|
||||
|
||||
#include <string.h>
|
||||
#ifdef __APPLE__
|
||||
// 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
|
Loading…
Reference in a new issue