2020-09-28 08:59:45 +08:00
|
|
|
diff --git a/include/CPstrings.h b/include/CPstrings.h
|
2023-03-21 02:33:03 +08:00
|
|
|
index 711981c..9d379d2 100644
|
2020-09-28 08:59:45 +08:00
|
|
|
--- a/include/CPstrings.h
|
|
|
|
+++ b/include/CPstrings.h
|
|
|
|
@@ -6,6 +6,8 @@
|
2023-03-21 02:33:03 +08:00
|
|
|
#include <algorithm>
|
|
|
|
#include <functional>
|
|
|
|
#include <cctype>
|
|
|
|
+#include <vector>
|
|
|
|
+#include <string>
|
2020-09-28 08:59:45 +08:00
|
|
|
|
|
|
|
#if !defined(NO_FMTLIB)
|
2023-03-21 02:33:03 +08:00
|
|
|
# ifndef FMT_HEADER_ONLY
|
2020-09-28 08:59:45 +08:00
|
|
|
@@ -14,9 +16,6 @@
|
2023-03-21 02:33:03 +08:00
|
|
|
# include "fmt/format.h" // For addition of the string formatting functions and macros from fmtlib
|
|
|
|
# include "fmt/printf.h" // For sprintf
|
|
|
|
# undef FMT_HEADER_ONLY
|
2020-09-28 08:59:45 +08:00
|
|
|
-#else
|
2023-03-21 02:33:03 +08:00
|
|
|
-# include <vector>
|
|
|
|
-# include <string>
|
2020-09-28 08:59:45 +08:00
|
|
|
#endif
|
|
|
|
|
2023-03-21 02:33:03 +08:00
|
|
|
#include "Exceptions.h"
|
|
|
|
@@ -75,11 +74,12 @@ inline bool endswith(const std::string& s1, const std::string& s2) {
|
|
|
|
// Missing string formatting function, this old guy is needed for ancient gcc compilers on PowerPC for VxWorks
|
|
|
|
inline std::string format(const char* fmt, ...);
|
2020-09-28 08:59:45 +08:00
|
|
|
#else
|
2023-03-21 02:33:03 +08:00
|
|
|
-// Missing std::string formatting function - provided by the fmtlib library
|
|
|
|
-inline std::string format(const char* format, fmt::ArgList args) {
|
|
|
|
- return fmt::sprintf(format, args);
|
|
|
|
+template<class...Args>
|
|
|
|
+std::string format(const Args & ... args)
|
|
|
|
+{
|
|
|
|
+ return fmt::sprintf(args...);
|
|
|
|
}
|
|
|
|
-FMT_VARIADIC(std::string, format, const char*)
|
|
|
|
+
|
|
|
|
// For latest FMTLIB
|
|
|
|
/*template <typename... Args>
|
2020-09-28 08:59:45 +08:00
|
|
|
inline std::string format(const char *format_str, const Args & ... args) {
|