Skip to content

Commit

Permalink
Don't use std::format if not available
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Sep 21, 2024
1 parent 9ceba68 commit 1c38086
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/pseudo_translate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ namespace i18n_check
continue;
}
else if ((msg[i] == L'r' || msg[i] == L'n' || msg[i] == L't') && i > 0 &&
msg[i - 1] == L'\\')
msg[i - 1] == L'\\')
{
i -= 2;
continue;
Expand Down Expand Up @@ -317,10 +317,12 @@ namespace i18n_check
// account when increasing the width of the message later
const std::wstring trackPrefix = [this]()
{
#if __cpp_lib_format > 201907L
if (m_track)
{
return L"[" + std::format(L"{:06X}", m_current_id++) + L"]";
}
#endif
return std::wstring{};
}();

Expand Down
4 changes: 3 additions & 1 deletion src/pseudo_translate.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

#include "i18n_review.h"
#include <cmath>
#include <format>
#if __has_include(<format>)
#include <format>
#endif
#include <map>
#include <regex>
#include <set>
Expand Down

0 comments on commit 1c38086

Please sign in to comment.