Skip to content

Commit

Permalink
Don't use std::format
Browse files Browse the repository at this point in the history
  • Loading branch information
vvromanov committed Jan 4, 2025
1 parent 313e682 commit 2005195
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/JsonDumper.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include <cmath>
#include <cstdint>
#include <format>
#include <functional>
#include <ostream>
#include <stack>
Expand Down Expand Up @@ -200,9 +199,11 @@ class JsonDumper {
case '\t':
s << "\\t";
break;
default:
s << std::format("\\u{:04x}", static_cast<uint16_t>(c));
break;
default: {
char tmp[sizeof("\\u0000") + 1];
snprintf(tmp, sizeof(tmp), "\\u%04x", c);
s << tmp;
} break;
}
} else {
s << c;
Expand Down

0 comments on commit 2005195

Please sign in to comment.