From 8111b77e95b083137faf888aeb5892073adf7ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 27 Jun 2018 16:59:37 +0200 Subject: New upstream version 2.0.0 --- lib/spdlog/fmt/bundled/ostream.cc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lib/spdlog/fmt/bundled/ostream.cc (limited to 'lib/spdlog/fmt/bundled/ostream.cc') diff --git a/lib/spdlog/fmt/bundled/ostream.cc b/lib/spdlog/fmt/bundled/ostream.cc new file mode 100644 index 0000000..2d443f7 --- /dev/null +++ b/lib/spdlog/fmt/bundled/ostream.cc @@ -0,0 +1,35 @@ +/* + Formatting library for C++ - std::ostream support + + Copyright (c) 2012 - 2016, Victor Zverovich + All rights reserved. + + For the license information refer to format.h. + */ + +#include "ostream.h" + +namespace fmt { + +namespace internal { +FMT_FUNC void write(std::ostream &os, Writer &w) { + const char *data = w.data(); + typedef internal::MakeUnsigned::Type UnsignedStreamSize; + UnsignedStreamSize size = w.size(); + UnsignedStreamSize max_size = + internal::to_unsigned((std::numeric_limits::max)()); + do { + UnsignedStreamSize n = size <= max_size ? size : max_size; + os.write(data, static_cast(n)); + data += n; + size -= n; + } while (size != 0); +} +} + +FMT_FUNC void print(std::ostream &os, CStringRef format_str, ArgList args) { + MemoryWriter w; + w.write(format_str, args); + internal::write(os, w); +} +} // namespace fmt -- cgit v1.2.3