[libcxx-commits] [PATCH] D59525: Speed up certain locale functions on Windows

Tom Anderson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 19 13:04:20 PDT 2019


thomasanderson updated this revision to Diff 191376.

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

https://reviews.llvm.org/D59525

Files:
  src/support/win32/locale_win32.cpp


Index: src/support/win32/locale_win32.cpp
===================================================================
--- src/support/win32/locale_win32.cpp
+++ src/support/win32/locale_win32.cpp
@@ -87,10 +87,16 @@
 
 int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...)
 {
+#if !defined(_LIBCPP_MSVCRT)
     __libcpp_locale_guard __current(loc);
+#endif
     va_list ap;
     va_start( ap, format );
+#if defined(_LIBCPP_MSVCRT)
+    int result = _vsprintf_s_l( ret, n, format, loc, ap );
+#else
     int result = vsnprintf( ret, n, format, ap );
+#endif
     va_end(ap);
     return result;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59525.191376.patch
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190319/b2427eef/attachment-0001.bin>


More information about the libcxx-commits mailing list