Make updates for libfmt 5.0.0 backwards compatible

This commit is contained in:
Ray Speth 2018-05-26 22:08:07 -04:00
parent 99d4972e6b
commit 3be3f7dad5

View file

@ -1,4 +1,6 @@
//! @file fmt.h Wrapper for either system-installed or local headers for fmt
#ifndef CT_FMT_H
#define CT_FMT_H
#include "ct_defs.h"
//! Do not use the fmt macro from fmtlib because it shadows a function of
@ -18,3 +20,19 @@
#endif
#include "cantera/ext/fmt/ostream.h"
#endif
#if !defined(FMT_VERSION) || FMT_VERSION < 50000
namespace fmt {
using memory_buffer = MemoryWriter;
}
template <typename... Args>
void format_to(fmt::memory_buffer& b, Args... args) {
b.write(args...);
}
inline std::string to_string(fmt::memory_buffer& b) {
return b.str();
}
#endif
#endif