Minimal set of fixes to build with MinGW.

actorid
Yuri Krupenin 14 years ago
parent f3ae1ea737
commit 6b6ee5440e

@ -1,6 +1,8 @@
#ifndef _ESM_READER_H
#define _ESM_READER_H
#include <string.h>
#include <string>
#include <libs/platform/stdint.h>
#include <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 <string.h>
#ifdef __APPLE__
#if defined(__APPLE__) || defined(__MINGW32__)
// need our own implementation of strnlen
static size_t strnlen(const char *s, size_t n)
{

@ -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
// For GCC, just use strings.h (this applies to mingw too)
#if defined(__GNUC__)
# include <strings.h>
#elif defined(MSVC)
# pragma warning(disable: 4996)
# define strcasecmp stricmp
# define snprintf _snprintf
#else
#include <strings.h>
#endif
# warning "Unable to determine your compiler, you should probably take a look here."
# include <strings.h> // Just take a guess
#endif
#endif
#endif /* _STRINGS_WRAPPER_H */

Loading…
Cancel
Save