mirror of https://github.com/OpenMW/openmw.git
Create platform component for platform specific things
parent
787f8fb627
commit
d5ec959449
@ -0,0 +1,23 @@
|
|||||||
|
#include "platform.hpp"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
namespace Platform {
|
||||||
|
|
||||||
|
static void increaseFileHandleLimit()
|
||||||
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
// Increase limit for open files at the stream I/O level, see
|
||||||
|
// https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmaxstdio?view=msvc-170#remarks
|
||||||
|
_setmaxstdio(8192);
|
||||||
|
#else
|
||||||
|
// No-op on any other platform.
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void init()
|
||||||
|
{
|
||||||
|
increaseFileHandleLimit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
#ifndef OPENMW_COMPONENTS_PLATFORM_PLATFORM_HPP
|
||||||
|
#define OPENMW_COMPONENTS_PLATFORM_PLATFORM_HPP
|
||||||
|
|
||||||
|
namespace Platform {
|
||||||
|
|
||||||
|
void init();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // OPENMW_COMPONENTS_PLATFORM_PLATFORM_HPP
|
Loading…
Reference in New Issue