[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:
parent
d67b0997d2
commit
02d3cc97fa
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue