From c03c17767b2a15ffbb5713135819c885b8c5bec5 Mon Sep 17 00:00:00 2001 From: George Tokmaji Date: Wed, 28 Aug 2024 18:03:21 +0200 Subject: [PATCH] Set SPDLOG_EOL to LF instead of CRLF and use LF with Clonk.log on all operating systems --- CMakeLists.txt | 1 + src/C4Log.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe421f37..16c742c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -433,6 +433,7 @@ set(SPDLOG_USE_STD_FORMAT ON) FetchContent_MakeAvailable(spdlog) +target_compile_definitions(spdlog PUBLIC SPDLOG_EOL=\"\\x0A\") target_link_libraries(standard spdlog::spdlog) # Link Windows Imaging Component diff --git a/src/C4Log.cpp b/src/C4Log.cpp index 8edfe0eb..19c05344 100644 --- a/src/C4Log.cpp +++ b/src/C4Log.cpp @@ -108,7 +108,7 @@ C4LogSystem::LogSink::LogSink() // open int iLog = 2; #ifdef _WIN32 - while (!(file = _fsopen(logFileName.c_str(), "wt", _SH_DENYWR))) + while (!(file = _fsopen(logFileName.c_str(), "wb", _SH_DENYWR))) #else while (!(file = fopen(logFileName.c_str(), "wb"))) #endif