Cantera  2.5.1
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 //! Use header-only library to avoid relocation issues with linking to the
11 //! static libfmt.a
12 #define FMT_HEADER_ONLY
13 
14 //! Versions 6.2.0 and 6.2.1 of fmtlib do not include this define before they
15 //! include windows.h, breaking builds on Windows. Fixed in fmtlib 7.0.0 and
16 //! newer. https://github.com/fmtlib/fmt/pull/1616
17 #if defined(_WIN32) && !defined(NOMINMAX)
18 #define NOMINMAX
19 #endif
20 #if CT_USE_SYSTEM_FMT
21  #include "fmt/format.h"
22  #if defined(FMT_VERSION) && FMT_VERSION >= 40000
23  #include "fmt/printf.h"
24  #endif
25  #include "fmt/ostream.h"
26 #else
27  #include "cantera/ext/fmt/format.h"
28  #if defined(FMT_VERSION) && FMT_VERSION >= 40000
29  #include "cantera/ext/fmt/printf.h"
30  #endif
31  #include "cantera/ext/fmt/ostream.h"
32 #endif
33 
34 #if !defined(FMT_VERSION) || FMT_VERSION < 50000
35 namespace fmt {
36 using memory_buffer = MemoryWriter;
37 }
38 template <typename... Args>
39 void format_to(fmt::memory_buffer& b, Args... args) {
40  b.write(args...);
41 }
42 inline std::string to_string(fmt::memory_buffer& b) {
43  return b.str();
44 }
45 
46 #endif
47 
48 #endif
ct_defs.h
fmt
Versions 6.2.0 and 6.2.1 of fmtlib do not include this define before they include windows....
Definition: fmt.h:35