[Lldb-commits] [PATCH] D67861: [LLDB] Check for the __MINGW32__ define instead of __MINGW64
Martin Storsjö via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 23 03:14:15 PDT 2019
mstorsjo added a comment.
In D67861#1678618 <https://reviews.llvm.org/D67861#1678618>, @labath wrote:
> Judging by the microsoft docs <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l?view=vs-2017>, `vsnprintf` is avaliable at least since VS 2017 (the lowest version supported by llvm). Is it possible that we can just delete this `#ifdef` ?
Yes, it would seem so.
With MSVC, you got an MSVC-specific version of the CRT, and with the versions of MSVC we require, it is a C99 compliant one.
With MinGW, you can link either against the UCRT (the same modern CRT as MSVC uses these days) or msvcrt.dll (the old legacy one, shipped as a part of the OS). But I checked that this use of `vsnprintf(NULL, 0, ...)` does seem to work with the old msvcrt.dll since at least XP (and llvm requires a much newer version of Windows anyway), so I would say that it should be safe.
CHANGES SINCE LAST ACTION
More information about the lldb-commits