forked from mirror/openmw-tes3mp
Minimal set of fixes to build with MinGW.
This commit is contained in:
parent
f3ae1ea737
commit
6b6ee5440e
3 changed files with 18 additions and 11 deletions
|
@ -1,6 +1,8 @@
|
||||||
#ifndef _ESM_READER_H
|
#ifndef _ESM_READER_H
|
||||||
#define _ESM_READER_H
|
#define _ESM_READER_H
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <libs/platform/stdint.h>
|
#include <libs/platform/stdint.h>
|
||||||
#include <libs/platform/string.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
|
#ifndef _STRING_WRAPPER_H
|
||||||
#define _STRING_WRAPPER_H
|
#define _STRING_WRAPPER_H
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) || defined(__MINGW32__)
|
||||||
// need our own implementation of strnlen
|
// need our own implementation of strnlen
|
||||||
static size_t strnlen(const char *s, size_t n)
|
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
|
#ifndef _STRINGS_WRAPPER_H
|
||||||
#define _STRINGS_WRAPPER_H
|
#define _STRINGS_WRAPPER_H
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#pragma warning(disable: 4996)
|
|
||||||
#define strcasecmp stricmp
|
|
||||||
#define snprintf _snprintf
|
|
||||||
#else
|
|
||||||
#include <strings.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
// 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
|
||||||
|
# warning "Unable to determine your compiler, you should probably take a look here."
|
||||||
|
# include <strings.h> // Just take a guess
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _STRINGS_WRAPPER_H */
|
||||||
|
|
Loading…
Reference in a new issue