G M: Restore the ability for libcxx to compile again on mingw 64.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190837 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/src/locale.cpp b/src/locale.cpp
index 3f6d246..43603f0 100644
--- a/src/locale.cpp
+++ b/src/locale.cpp
@@ -28,7 +28,7 @@
#include "cstring"
#include "cwctype"
#include "__sso_allocator"
-#ifdef _LIBCPP_MSVCRT
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
#include <support/win32/locale_win32.h>
#else // _LIBCPP_MSVCRT
#include <langinfo.h>
@@ -1016,7 +1016,7 @@
return __cloc()->__ctype_b;
#elif __sun__
return __ctype_mask;
-#elif defined(_LIBCPP_MSVCRT)
+#elif defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
return _ctype+1; // internal ctype mask table defined in msvcrt.dll
// This is assumed to be safe, which is a nonsense assumption because we're
// going to end up dereferencing it later...
@@ -5857,7 +5857,7 @@
__frac_digits_ = lc->int_frac_digits;
else
__frac_digits_ = base::do_frac_digits();
-#ifdef _LIBCPP_MSVCRT
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
if (lc->p_sign_posn == 0)
#else // _LIBCPP_MSVCRT
if (lc->int_p_sign_posn == 0)
@@ -5865,7 +5865,7 @@
__positive_sign_ = "()";
else
__positive_sign_ = lc->positive_sign;
-#ifdef _LIBCPP_MSVCRT
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
if(lc->n_sign_posn == 0)
#else // _LIBCPP_MSVCRT
if (lc->int_n_sign_posn == 0)
@@ -5877,7 +5877,7 @@
// the same places in curr_symbol since there's no way to
// represent anything else.
string_type __dummy_curr_symbol = __curr_symbol_;
-#ifdef _LIBCPP_MSVCRT
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
__init_pat(__pos_format_, __dummy_curr_symbol, true,
lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, ' ');
__init_pat(__neg_format_, __curr_symbol_, true,
@@ -6016,7 +6016,7 @@
__frac_digits_ = lc->int_frac_digits;
else
__frac_digits_ = base::do_frac_digits();
-#ifdef _LIBCPP_MSVCRT
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
if (lc->p_sign_posn == 0)
#else // _LIBCPP_MSVCRT
if (lc->int_p_sign_posn == 0)
@@ -6036,7 +6036,7 @@
wbe = wbuf + j;
__positive_sign_.assign(wbuf, wbe);
}
-#ifdef _LIBCPP_MSVCRT
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
if (lc->n_sign_posn == 0)
#else // _LIBCPP_MSVCRT
if (lc->int_n_sign_posn == 0)
@@ -6060,7 +6060,7 @@
// the same places in curr_symbol since there's no way to
// represent anything else.
string_type __dummy_curr_symbol = __curr_symbol_;
-#ifdef _LIBCPP_MSVCRT
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
__init_pat(__pos_format_, __dummy_curr_symbol, true,
lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, L' ');
__init_pat(__neg_format_, __curr_symbol_, true,