diff --git a/components/esm/esm_reader.hpp b/components/esm/esm_reader.hpp index 64e0861b5..3b9f241f1 100644 --- a/components/esm/esm_reader.hpp +++ b/components/esm/esm_reader.hpp @@ -1,6 +1,8 @@ #ifndef _ESM_READER_H #define _ESM_READER_H +#include + #include #include #include diff --git a/libs/platform/string.h b/libs/platform/string.h index dc25279fe..d4302ae78 100644 --- a/libs/platform/string.h +++ b/libs/platform/string.h @@ -1,9 +1,9 @@ -// Wrapper for string.h on Mac +// Wrapper for string.h on Mac and MinGW #ifndef _STRING_WRAPPER_H #define _STRING_WRAPPER_H #include -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__MINGW32__) // need our own implementation of strnlen static size_t strnlen(const char *s, size_t n) { diff --git a/libs/platform/strings.h b/libs/platform/strings.h index 0879ed87b..fd917065d 100644 --- a/libs/platform/strings.h +++ b/libs/platform/strings.h @@ -1,13 +1,18 @@ -// Wrapper for MSVC +// Wrapper for MSVC/GCC #ifndef _STRINGS_WRAPPER_H #define _STRINGS_WRAPPER_H -#ifdef WIN32 -#pragma warning(disable: 4996) -#define strcasecmp stricmp -#define snprintf _snprintf -#else -#include -#endif -#endif +// For GCC, just use strings.h (this applies to mingw too) +#if defined(__GNUC__) +# include +#elif defined(MSVC) +# pragma warning(disable: 4996) +# define strcasecmp stricmp +# define snprintf _snprintf +#else +# warning "Unable to determine your compiler, you should probably take a look here." +# include // Just take a guess +#endif + +#endif /* _STRINGS_WRAPPER_H */