From 4a4b2a3b50d587692555d0622f4abf418ed20326 Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Sun, 15 Nov 2026 19:01:51 +0100 Subject: [PATCH] Fixed a possible startup crash with a non-ANSI Documents path via a Clib fix --- source/Enderal DLL/CMakeLists.txt | 2 +- source/Enderal DLL/src/Main.cpp | 2 +- source/Enderal DLL/src/PCH.h | 1 - source/Steam DLL/CMakeLists.txt | 2 +- source/Steam DLL/src/Main.cpp | 26 ++------------------------ source/Steam DLL/src/PCH.h | 1 - 6 files changed, 5 insertions(+), 29 deletions(-) diff --git a/source/Enderal DLL/CMakeLists.txt b/source/Enderal DLL/CMakeLists.txt index 7193273f4..18ac133b3 100644 --- a/source/Enderal DLL/CMakeLists.txt +++ b/source/Enderal DLL/CMakeLists.txt @@ -149,7 +149,7 @@ message(STATUS "Fetching CommonLibSSE-GG...") FetchContent_Declare( CommonLibSSE GIT_REPOSITORY https://github.com/eddoursul/CommonLibSSE-GG - GIT_TAG ff1a91b895af60fe7412b66544dfc4bce64c7286 + GIT_TAG 5507da62fef3853b15e6285f9a758b17c58f95b7 ) FetchContent_MakeAvailable(CommonLibSSE) diff --git a/source/Enderal DLL/src/Main.cpp b/source/Enderal DLL/src/Main.cpp index 6fa2aaba8..f3b103db4 100644 --- a/source/Enderal DLL/src/Main.cpp +++ b/source/Enderal DLL/src/Main.cpp @@ -59,7 +59,7 @@ namespace { path /= "SKSE"sv; path /= "EnderalSE.log"sv; - auto sink = std::make_shared(path.string(), true); + auto sink = logger::file_sink(path); auto log = std::make_shared("global log"s, std::move(sink)); log->set_level(spdlog::level::info); diff --git a/source/Enderal DLL/src/PCH.h b/source/Enderal DLL/src/PCH.h index 1267ede6f..3b224973a 100644 --- a/source/Enderal DLL/src/PCH.h +++ b/source/Enderal DLL/src/PCH.h @@ -9,7 +9,6 @@ #include #undef cdecl // Workaround for Clang 14 CMake configure error. -#include #include #include diff --git a/source/Steam DLL/CMakeLists.txt b/source/Steam DLL/CMakeLists.txt index 73bdd7532..91e065d0f 100644 --- a/source/Steam DLL/CMakeLists.txt +++ b/source/Steam DLL/CMakeLists.txt @@ -157,7 +157,7 @@ message(STATUS "Fetching CommonLibSSE-GG...") FetchContent_Declare( CommonLibSSE GIT_REPOSITORY https://github.com/eddoursul/CommonLibSSE-GG - GIT_TAG ff1a91b895af60fe7412b66544dfc4bce64c7286 + GIT_TAG 5507da62fef3853b15e6285f9a758b17c58f95b7 ) FetchContent_MakeAvailable(CommonLibSSE) diff --git a/source/Steam DLL/src/Main.cpp b/source/Steam DLL/src/Main.cpp index a4ed40d3b..1e01c74dd 100644 --- a/source/Steam DLL/src/Main.cpp +++ b/source/Steam DLL/src/Main.cpp @@ -5,40 +5,18 @@ using namespace SKSE; -namespace { - - void InitializeLogging() { - auto path = logger::log_directory(); - if (!path) { - SKSE::stl::report_and_fail("Failed to find standard logging directory"sv); - } - - *path /= "EnderalSteam.log"sv; - auto sink = std::make_shared(path->string(), true); - - auto log = std::make_shared("global log"s, std::move(sink)); - - log->set_level(spdlog::level::info); - log->flush_on(spdlog::level::info); - - spdlog::set_default_logger(std::move(log)); - spdlog::set_pattern("[%l] %v"s); - } -} - SKSEPluginLoad(const LoadInterface* skse) { GetLoadInterface(skse); - InitializeLogging(); + // Also opens EnderalSteam.log, through SKSE::log::init() + Init(skse); auto* plugin = PluginDeclaration::GetSingleton(); auto version = plugin->GetVersion(); logger::info("{} {} is loading...", plugin->GetName(), version); logger::info("Built against Steamworks SDK {}", ENDERAL_STEAM_SDK); - Init(skse); - // SDK 1.55: has to happen here, not from a game event: the game opens its own Steam session // from BSWin32SystemUtility during WinMain, and whichever session is opened first // decides which AppID the process stays registered as. diff --git a/source/Steam DLL/src/PCH.h b/source/Steam DLL/src/PCH.h index eed4d90ab..c87aff02a 100644 --- a/source/Steam DLL/src/PCH.h +++ b/source/Steam DLL/src/PCH.h @@ -104,7 +104,6 @@ #include #undef cdecl // Workaround for Clang 14 CMake configure error. -#include #include // Compatible declarations with other sample projects.