oops
This commit is contained in:
parent
39e4a4bb90
commit
9f3f95d611
|
@ -36,8 +36,13 @@ namespace swbf {
|
|||
template<class ...Args>
|
||||
inline void fprint(std::FILE* file, std::string_view format, Args&&... args) {
|
||||
#ifdef _WIN32
|
||||
// windows vt handling is DOG slow. don't know why lmao
|
||||
auto str = std::vformat(format, std::make_format_args(args...));
|
||||
WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), str.data(), str.length(), nullptr, nullptr);
|
||||
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if(file == stderr)
|
||||
handle = GetStdHandle(STD_ERROR_HANDLE);
|
||||
|
||||
WriteConsole(handle, str.data(), str.length(), nullptr, nullptr);
|
||||
#else
|
||||
std::vformat_to(FputcIterator(file), format, std::make_format_args(args...));
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue