Fix missing includes in format_string.hpp helper

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337886 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2018-07-25 04:21:59 +00:00
parent d3e32d2c53
commit bb00305f46

View File

@@ -5,23 +5,24 @@
#include <string> #include <string>
#include <memory> #include <memory>
#include <array> #include <array>
#include <cstdarg>
namespace format_string_detail { namespace format_string_detail {
inline std::string format_string_imp(const char* msg, ...) { inline std::string format_string_imp(const char* msg, ...) {
// we might need a second shot at this, so pre-emptivly make a copy // we might need a second shot at this, so pre-emptivly make a copy
struct GuardVAList { struct GuardVAList {
va_list& target; va_list& xtarget;
bool active; bool active;
GuardVAList(va_list& target) : target(target), active(true) {} GuardVAList(va_list& val) : xtarget(val), active(true) {}
void clear() { void clear() {
if (active) if (active)
va_end(target); va_end(xtarget);
active = false; active = false;
} }
~GuardVAList() { ~GuardVAList() {
if (active) if (active)
va_end(target); va_end(xtarget);
} }
}; };
va_list args; va_list args;