[libcxx-commits] [PATCH] D59727: [libc++] Fix return value of snprintf_l() on Windows when buffer is too small

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 26 12:45:17 PDT 2019


mstorsjo added inline comments.


================
Comment at: src/support/win32/locale_win32.cpp:92
     va_start( ap, format );
-#if defined(_LIBCPP_MSVCRT)
-    int result = _vsnprintf_l( ret, n, format, loc, ap );
+#if defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__)
+    // FIXME: Remove usage of internal CRT function and globals.
----------------
smeenai wrote:
> From `__config`:
> 
> ```
> #  if defined(_MSC_VER) && !defined(__MINGW32__)
> #    define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
> #  endif
> ```
> 
> So checking for `!defined(__MINGW32__)` here is redundant.
Oh, right. Sorry for the confusion and noise!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59727/new/

https://reviews.llvm.org/D59727





More information about the libcxx-commits mailing list