mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-11-27 13:50:23 +00:00
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:
parent
d3e32d2c53
commit
bb00305f46
@ -5,23 +5,24 @@
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <array>
|
||||
#include <cstdarg>
|
||||
|
||||
namespace format_string_detail {
|
||||
inline std::string format_string_imp(const char* msg, ...) {
|
||||
// we might need a second shot at this, so pre-emptivly make a copy
|
||||
struct GuardVAList {
|
||||
va_list& target;
|
||||
va_list& xtarget;
|
||||
bool active;
|
||||
GuardVAList(va_list& target) : target(target), active(true) {}
|
||||
GuardVAList(va_list& val) : xtarget(val), active(true) {}
|
||||
|
||||
void clear() {
|
||||
if (active)
|
||||
va_end(target);
|
||||
va_end(xtarget);
|
||||
active = false;
|
||||
}
|
||||
~GuardVAList() {
|
||||
if (active)
|
||||
va_end(target);
|
||||
va_end(xtarget);
|
||||
}
|
||||
};
|
||||
va_list args;
|
||||
|
Loading…
Reference in New Issue
Block a user