mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Create platform component for platform specific things
This commit is contained in:
parent
787f8fb627
commit
d5ec959449
8 changed files with 54 additions and 0 deletions
23
components/platform/platform.cpp
Normal file
23
components/platform/platform.cpp
Normal file
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue