mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Make Console::Write functions atomic
This commit is contained in:
committed by
Aaron van Geffen
parent
7da60f4950
commit
dd58a710ee
@@ -15,6 +15,7 @@
|
||||
#pragma endregion
|
||||
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
|
||||
#include "Console.hpp"
|
||||
#include "../platform/platform.h"
|
||||
@@ -33,10 +34,8 @@ namespace Console
|
||||
|
||||
void WriteSpace(size_t count)
|
||||
{
|
||||
for (size_t i = 0; i < count; i++)
|
||||
{
|
||||
Write(' ');
|
||||
}
|
||||
std::string sz(count, ' ');
|
||||
Write(sz.c_str());
|
||||
}
|
||||
|
||||
void WriteFormat(const utf8 * format, ...)
|
||||
@@ -58,8 +57,8 @@ namespace Console
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
vfprintf(stdout, format, args);
|
||||
puts("");
|
||||
auto formatLn = std::string(format) + "\n";
|
||||
vfprintf(stdout, formatLn.c_str(), args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
@@ -99,8 +98,8 @@ namespace Console
|
||||
|
||||
void WriteLine_VA(const utf8 * format, va_list args)
|
||||
{
|
||||
vfprintf(stdout, format, args);
|
||||
puts("");
|
||||
auto formatLn = std::string(format) + "\n";
|
||||
vfprintf(stdout, formatLn.c_str(), args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user