Cantera  3.1.0
Loading...
Searching...
No Matches
fmt.h
Go to the documentation of this file.
1//! @file fmt.h Wrapper for either system-installed or local headers for fmt
2#ifndef CT_FMT_H
3#define CT_FMT_H
4#include "ct_defs.h"
5
6//! Do not use the fmt macro from fmtlib because it shadows a function of
7//! the same name in kinetics/Group.h
8#define FMT_NO_FMT_STRING_ALIAS
9
10//! Versions 6.2.0 and 6.2.1 of fmtlib do not include this define before they
11//! include windows.h, breaking builds on Windows. Fixed in fmtlib 7.0.0 and
12//! newer. https://github.com/fmtlib/fmt/pull/1616
13#if defined(_WIN32) && !defined(NOMINMAX)
14#define NOMINMAX
15#endif
16
17#if CT_USE_SYSTEM_FMT
18 #include <fmt/format.h>
19 #include <fmt/printf.h>
20 #include <fmt/ostream.h>
21#else
22 #include "cantera/ext/fmt/format.h"
23 #include "cantera/ext/fmt/printf.h"
24 #include "cantera/ext/fmt/ostream.h"
25#endif
26
27#if FMT_VERSION < 80000
28template <typename... Args>
29void fmt_append(fmt::memory_buffer& b, const std::string& tmpl, Args... args) {
30 format_to(b, tmpl, args...);
31}
32namespace fmt {
33template <typename T>
34T runtime(T arg) {
35 return arg;
36}
37}
38#else
39template <typename... Args>
40void fmt_append(fmt::memory_buffer& b, const std::string& tmpl, Args... args) {
41 format_to(fmt::appender(b), fmt::runtime(tmpl), args...);
42}
43#endif
44
45#if FMT_VERSION > 100000
46 #if CT_USE_SYSTEM_FMT
47 #include <fmt/ranges.h>
48 #else
49 #include <fmt/join.h>
50 #endif
51#endif
52
53#endif
This file contains definitions of constants, types and terms that are used in internal routines and a...
void fmt_append(fmt::memory_buffer &b, const std::string &tmpl, Args... args)
Versions 6.2.0 and 6.2.1 of fmtlib do not include this define before they include windows....
Definition fmt.h:29