mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:44:13 +08:00
40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
|
diff --git a/include/CPstrings.h b/include/CPstrings.h
|
||
|
index 2e5a5af..87f6b7c 100644
|
||
|
--- a/include/CPstrings.h
|
||
|
+++ b/include/CPstrings.h
|
||
|
@@ -5,6 +5,8 @@
|
||
|
#include <iterator>
|
||
|
#include <algorithm>
|
||
|
#include <functional>
|
||
|
+ #include <vector>
|
||
|
+ #include <string>
|
||
|
|
||
|
#if !defined(NO_CPPFORMAT)
|
||
|
#ifndef FMT_HEADER_ONLY
|
||
|
@@ -13,9 +15,6 @@
|
||
|
#include "fmt/format.h" // For addition of the string formatting functions and macros from cppformat
|
||
|
#include "fmt/printf.h" // For sprintf
|
||
|
#undef FMT_HEADER_ONLY
|
||
|
-#else
|
||
|
- #include <vector>
|
||
|
- #include <string>
|
||
|
#endif
|
||
|
|
||
|
#include "Exceptions.h"
|
||
|
@@ -57,11 +56,11 @@
|
||
|
// Missing string formatting function, this old guy is needed for ancient gcc compilers on PowerPC for VxWorks
|
||
|
inline std::string format(const char* fmt, ...);
|
||
|
#else
|
||
|
- // Missing std::string formatting function - provided by the cppformat 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 *)
|
||
|
#endif
|
||
|
|
||
|
// Missing string split - like in Python
|