Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/server/main.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2025-04-30 15:14:49 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2025-04-30 15:14:49 +1000
commita521dc5c74d54466dd3fc432057b96c30504a748 (patch)
tree8240eff0bdf1aba309c27ed0a9e772a2db43e425 /source/server/main.cpp
parentd8db6199e13b5405123f18cc1a9631f7e7f4794a (diff)
Guarantee stack space in exception handling so printing stack overflows doesn't fail
Diffstat (limited to 'source/server/main.cpp')
-rw-r--r--source/server/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/server/main.cpp b/source/server/main.cpp
index ac40524..3bfb197 100644
--- a/source/server/main.cpp
+++ b/source/server/main.cpp
@@ -12,6 +12,10 @@
using namespace Star;
+#if defined STAR_SYSTEM_WINDOWS
+#include <windows.h>
+#endif
+
Json const AdditionalDefaultConfiguration = Json::parseJson(R"JSON(
{
"configurationVersion" : {
@@ -35,6 +39,10 @@ Json const AdditionalDefaultConfiguration = Json::parseJson(R"JSON(
int main(int argc, char** argv) {
try {
+ #if defined STAR_SYSTEM_WINDOWS
+ unsigned long exceptionStackSize = 16384;
+ SetThreadStackGuarantee(&exceptionStackSize);
+ #endif
RootLoader rootLoader({{}, AdditionalDefaultConfiguration, String("starbound_server.log"), LogLevel::Info, false, String("starbound_server.config")});
RootUPtr root = rootLoader.commandInitOrDie(argc, argv).first;
root->fullyLoad();