From 21d09d4bcded055a7d09e669d06faa969cf130f6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 8 Jun 2018 23:11:53 +0200 Subject: [PATCH] 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. --- .../include/nlohmann/detail/output/serializer.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/nlohmann-json/include/nlohmann/detail/output/serializer.hpp b/lib/nlohmann-json/include/nlohmann/detail/output/serializer.hpp index a64426444..84487bc17 100644 --- a/lib/nlohmann-json/include/nlohmann/detail/output/serializer.hpp +++ b/lib/nlohmann-json/include/nlohmann/detail/output/serializer.hpp @@ -354,15 +354,15 @@ class serializer { if (codepoint <= 0xFFFF) { - std::snprintf(string_buffer.data() + bytes, 7, "\\u%04x", - static_cast(codepoint)); + ::snprintf(string_buffer.data() + bytes, 7, "\\u%04x", + static_cast(codepoint)); bytes += 6; } else { - std::snprintf(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x", - static_cast(0xD7C0 + (codepoint >> 10)), - static_cast(0xDC00 + (codepoint & 0x3FF))); + ::snprintf(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x", + static_cast(0xD7C0 + (codepoint >> 10)), + static_cast(0xDC00 + (codepoint & 0x3FF))); bytes += 12; } }