1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
diff --git a/src/util/FormatString.cxx b/src/util/FormatString.cxx
index 57ea57525..28825cd5c 100644
--- a/src/util/FormatString.cxx
+++ b/src/util/FormatString.cxx
@@ -30,7 +30,6 @@
AllocatedString<>
FormatStringV(const char *fmt, va_list args) noexcept
{
-#ifndef WIN32
va_list tmp;
va_copy(tmp, args);
const int length = vsnprintf(NULL, 0, fmt, tmp);
@@ -43,22 +42,6 @@ FormatStringV(const char *fmt, va_list args) noexcept
char *buffer = new char[length + 1];
vsnprintf(buffer, length + 1, fmt, args);
return AllocatedString<>::Donate(buffer);
-#else
- /* On mingw32, snprintf() expects a 64 bit integer instead of
- a "long int" for "%li". This is not consistent with our
- expectation, so we're using plain sprintf() here, hoping
- the static buffer is large enough. Sorry for this hack,
- but WIN32 development is so painful, I'm not in the mood to
- do it properly now. */
-
- char buffer[16384];
- vsprintf(buffer, fmt, args);
-
- const size_t length = strlen(buffer);
- char *p = new char[length + 1];
- memcpy(p, buffer, length + 1);
- return AllocatedString<>::Donate(p);
-#endif
}
AllocatedString<>
|