mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-25 04:11:44 +00:00
nlohmann JSON: don't use std::snprintf
libintl.h defines a preprocessor define for `snprintf` with the content of `libintl_snprintf` if the C library isn't GNU's glibc. Therefore `std::snprintf` actually becomes `std::libintl_snprintf` which doesn't exist. This affects e.g. mingw and macOS.
This commit is contained in:
parent
bc12006391
commit
21d09d4bcd
@ -354,15 +354,15 @@ class serializer
|
||||
{
|
||||
if (codepoint <= 0xFFFF)
|
||||
{
|
||||
std::snprintf(string_buffer.data() + bytes, 7, "\\u%04x",
|
||||
static_cast<uint16_t>(codepoint));
|
||||
::snprintf(string_buffer.data() + bytes, 7, "\\u%04x",
|
||||
static_cast<uint16_t>(codepoint));
|
||||
bytes += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::snprintf(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x",
|
||||
static_cast<uint16_t>(0xD7C0 + (codepoint >> 10)),
|
||||
static_cast<uint16_t>(0xDC00 + (codepoint & 0x3FF)));
|
||||
::snprintf(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x",
|
||||
static_cast<uint16_t>(0xD7C0 + (codepoint >> 10)),
|
||||
static_cast<uint16_t>(0xDC00 + (codepoint & 0x3FF)));
|
||||
bytes += 12;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user