mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-21 22:02:37 +00:00
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:
@@ -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 ();
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user