kobo cheats death again (+1 squashed commits)

Squashed commits:

[708e2429] kobo cheats death again
This commit is contained in:
Concedo 2025-01-04 00:49:04 +08:00
parent f9f1585a7f
commit b4dc29f425
10 changed files with 225 additions and 46 deletions

View file

@ -62,19 +62,6 @@ void replace_all_chars(std::string& str, char target, char replacement) {
}
}
std::string format(const char* fmt, ...) {
va_list ap;
va_list ap2;
va_start(ap, fmt);
va_copy(ap2, ap);
int size = vsnprintf(NULL, 0, fmt, ap);
std::vector<char> buf(size + 1);
int size2 = vsnprintf(buf.data(), size + 1, fmt, ap2);
va_end(ap2);
va_end(ap);
return std::string(buf.data(), size);
}
#ifdef _WIN32 // code for windows
#include <windows.h>