Cantera  2.4.0
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 #if CT_USE_SYSTEM_FMT
15  #include "fmt/format.h"
16  #if defined(FMT_VERSION) && FMT_VERSION >= 40000
17  #include "fmt/printf.h"
18  #endif
19  #include "fmt/ostream.h"
20 #else
21  #include "cantera/ext/fmt/format.h"
22  #if defined(FMT_VERSION) && FMT_VERSION >= 40000
23  #include "cantera/ext/fmt/printf.h"
24  #endif
25  #include "cantera/ext/fmt/ostream.h"
26 #endif
27 
28 #if !defined(FMT_VERSION) || FMT_VERSION < 50000
29 namespace fmt {
30 using memory_buffer = MemoryWriter;
31 }
32 template <typename... Args>
33 void format_to(fmt::memory_buffer& b, Args... args) {
34  b.write(args...);
35 }
36 inline std::string to_string(fmt::memory_buffer& b) {
37  return b.str();
38 }
39 
40 #endif
41 
42 #endif
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
Definition: fmt.h:29