aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/fmt/patches/msvc-libcxx.patch
blob: d780a9b3088409c92d7ad34bc3e51480e279b5e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Use locate_t defined by libc++.

--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -339,1 +339,1 @@
-#if defined(_SECURE_SCL) && _SECURE_SCL
+#if defined(_SECURE_SCL) && _SECURE_SCL && !defined(_LIBCPP_VERSION)
--- a/include/fmt/os.h
+++ b/include/fmt/os.h
@@ -23,6 +23,10 @@
 #  include <xlocale.h>  // for LC_NUMERIC_MASK on OS X
 #endif
 
+#if defined(_WIN32)
+#  include <locale>  // for libc++ locale_win32.h
+#endif
+
 #include "format.h"
 
 // UWP doesn't provide _pipe.
@@ -348,5 +352,5 @@
 class locale {
  private:
-#  ifdef _WIN32
+#  if defined(_WIN32) && !defined(_LIBCPP_VERSION)
   using locale_t = _locale_t;
 
@@ -367,3 +371,3 @@ class locale {
   locale() {
-#  ifndef _WIN32
+#  if !defined(_WIN32) || defined(_LIBCPP_VERSION)
     locale_ = FMT_SYSTEM(newlocale(LC_NUMERIC_MASK, "C", nullptr));