[LLDB] Remove a now redundant windows specific workaround

vsnprintf(NULL, 0, ...) works for measuring the needed string
size on all supported Windows variants; it's supported since
at least MSVC 2015 (and LLVM requires a newer version than that),
and works on both msvcrt.dll (since at least XP) and UCRT with MinGW.

The previous use of ifdefs was wrong as well, as __MINGW64__ only is
defined for 64 bit targets, and the define without trailing
underscores is never defined automatically (neither by clang nor
by gcc).

Differential Revision: https://reviews.llvm.org/D67861

llvm-svn: 372591
This commit is contained in:
Martin Storsjo 2019-09-23 12:03:33 +00:00
parent d67b0997d2
commit 02d3cc97fa
1 changed files with 0 additions and 5 deletions

View File

@ -48,13 +48,8 @@ int vasprintf(char **ret, const char *fmt, va_list ap) {
size_t buflen; size_t buflen;
va_list ap2; va_list ap2;
#if defined(_MSC_VER) || defined(__MINGW64)
ap2 = ap;
len = _vscprintf(fmt, ap2);
#else
va_copy(ap2, ap); va_copy(ap2, ap);
len = vsnprintf(NULL, 0, fmt, ap2); len = vsnprintf(NULL, 0, fmt, ap2);
#endif
if (len >= 0 && if (len >= 0 &&
(buf = (char *)malloc((buflen = (size_t)(len + 1)))) != NULL) { (buf = (char *)malloc((buflen = (size_t)(len + 1)))) != NULL) {