Unix: fix SystemLog include cycle in debug builds

With DEBUG enabled, including StringConverter.h reaches SystemLog.h through
PlatformBase.h before StringConverter is declared. The inline
WriteException implementation then fails to compile.

Move WriteException into Unix/SystemLog.cpp and include StringConverter.h
there, keeping the logging behavior unchanged while removing the header
dependency cycle.
This commit is contained in:
Mounir IDRASSI
2026-10-10 20:33:18 +09:00
parent ac842e8d04
commit 3e3a271e52
2 changed files with 7 additions and 5 deletions
+1 -5
View File
@@ -14,7 +14,6 @@
#define TC_HEADER_Platform_SystemLog
#include "Platform/PlatformBase.h"
#include "Platform/StringConverter.h"
namespace VeraCrypt
{
@@ -24,10 +23,7 @@ namespace VeraCrypt
static void WriteDebug (const string &debugMessage);
static void WriteError (const string &errorMessage);
static void WriteException (const exception &ex)
{
WriteError (string ("exception: ") + StringConverter::ToSingle (StringConverter::ToExceptionString (ex)));
}
static void WriteException (const exception &ex);
protected:
SystemLog ();
+6
View File
@@ -12,6 +12,7 @@
#include <syslog.h>
#include "Platform/SystemLog.h"
#include "Platform/StringConverter.h"
namespace VeraCrypt
{
@@ -28,4 +29,9 @@ namespace VeraCrypt
syslog (LOG_ERR, "%s", errorMessage.c_str());
closelog();
}
void SystemLog::WriteException (const exception &ex)
{
WriteError (string ("exception: ") + StringConverter::ToSingle (StringConverter::ToExceptionString (ex)));
}
}