diff --git a/CMakeLists.txt b/CMakeLists.txt index beed450848..a1cc058ce4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/components/esm/esm_reader.hpp b/components/esm/esm_reader.hpp index 76df4b5dc9..64e0861b58 100644 --- a/components/esm/esm_reader.hpp +++ b/components/esm/esm_reader.hpp @@ -3,10 +3,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -15,16 +15,6 @@ #include -#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 diff --git a/libs/platform/string.h b/libs/platform/string.h new file mode 100644 index 0000000000..dc25279fe9 --- /dev/null +++ b/libs/platform/string.h @@ -0,0 +1,14 @@ +// Wrapper for string.h on Mac +#ifndef _STRING_WRAPPER_H +#define _STRING_WRAPPER_H + +#include +#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