mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-30 13:57:59 +03:00
Imported Upstream version 0.26.0
This commit is contained in:
commit
9a2b6c69b6
1398 changed files with 212217 additions and 0 deletions
21
libs/platform/stdint.h
Normal file
21
libs/platform/stdint.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
// Wrapper for MSVC
|
||||
#ifndef _STDINT_WRAPPER_H
|
||||
#define _STDINT_WRAPPER_H
|
||||
|
||||
#if (_MSC_VER >= 1600)
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
// Pull the boost names into the global namespace for convenience
|
||||
using boost::int32_t;
|
||||
using boost::uint32_t;
|
||||
using boost::int64_t;
|
||||
using boost::uint64_t;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
34
libs/platform/string.h
Normal file
34
libs/platform/string.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Wrapper for string.h on Mac and MinGW
|
||||
#ifndef _STRING_WRAPPER_H
|
||||
#define _STRING_WRAPPER_H
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <Availability.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#if (defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1070) || defined(__MINGW32__)
|
||||
// need our own implementation of strnlen
|
||||
#ifdef __MINGW32__
|
||||
static size_t strnlen(const char *s, size_t n)
|
||||
{
|
||||
const char *p = (const char *)memchr(s, 0, n);
|
||||
return(p ? p-s : n);
|
||||
}
|
||||
#elif (defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
|
||||
static size_t mw_strnlen(const char *s, size_t n)
|
||||
{
|
||||
if (strnlen != NULL) {
|
||||
return strnlen(s, n);
|
||||
}
|
||||
else {
|
||||
const char *p = (const char *)memchr(s, 0, n);
|
||||
return(p ? p-s : n);
|
||||
}
|
||||
}
|
||||
#define strnlen mw_strnlen
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
18
libs/platform/strings.h
Normal file
18
libs/platform/strings.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Wrapper for MSVC/GCC
|
||||
#ifndef _STRINGS_WRAPPER_H
|
||||
#define _STRINGS_WRAPPER_H
|
||||
|
||||
|
||||
// For GCC, just use strings.h (this applies to mingw too)
|
||||
#if defined(__GNUC__)
|
||||
# include <strings.h>
|
||||
#elif defined(MSVC) || defined(_MSC_VER)
|
||||
# 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…
Add table
Add a link
Reference in a new issue