[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:31:24 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL356512: [libc++] Speed up certain locale functions on Windows (authored by thomasanderson, committed by ).
Herald added subscribers: llvm-commits, christof.
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D59525?vs=191380&id=191383#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D59525

Files:
  libcxx/trunk/src/support/win32/locale_win32.cpp


Index: libcxx/trunk/src/support/win32/locale_win32.cpp
===================================================================
--- libcxx/trunk/src/support/win32/locale_win32.cpp
+++ libcxx/trunk/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 = _vsnprintf_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.191383.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190319/69fd5f7b/attachment.bin>


More information about the libcxx-commits mailing list