Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: include/locale

Issue 1441603003: Cherry-pick upstream r252457 (Closed) Base URL: https://chromium.googlesource.com/a/native_client/pnacl-libcxx.git@master
Patch Set: Use __musl__ define to detect musl Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/__locale ('k') | include/support/musl/xlocale.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // -*- C++ -*- 1 // -*- C++ -*-
2 //===-------------------------- locale ------------------------------------===// 2 //===-------------------------- locale ------------------------------------===//
3 // 3 //
4 // The LLVM Compiler Infrastructure 4 // The LLVM Compiler Infrastructure
5 // 5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open 6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details. 7 // Source Licenses. See LICENSE.TXT for details.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 10
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 typedef _VSTD::remove_pointer<locale_t>::type __locale_struct; 228 typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
229 typedef _VSTD::unique_ptr<__locale_struct, decltype(&freelocale)> __locale_uniqu e_ptr; 229 typedef _VSTD::unique_ptr<__locale_struct, decltype(&freelocale)> __locale_uniqu e_ptr;
230 #ifndef _LIBCPP_LOCALE__L_EXTENSIONS 230 #ifndef _LIBCPP_LOCALE__L_EXTENSIONS
231 typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii; 231 typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
232 #endif 232 #endif
233 233
234 // OSX has nice foo_l() functions that let you turn off use of the global 234 // OSX has nice foo_l() functions that let you turn off use of the global
235 // locale. Linux, not so much. The following functions avoid the locale when 235 // locale. Linux, not so much. The following functions avoid the locale when
236 // that's possible and otherwise do the wrong thing. FIXME. 236 // that's possible and otherwise do the wrong thing. FIXME.
237 #if defined(__linux__) || defined(__EMSCRIPTEN__) || defined(_AIX) || \ 237 #if defined(__linux__) || defined(__EMSCRIPTEN__) || defined(_AIX) || \
238 defined(_NEWLIB_VERSION) 238 defined(_NEWLIB_VERSION) || defined(_LIBCPP_HAS_MUSL_LIBC)
239 239
240 #ifdef _LIBCPP_LOCALE__L_EXTENSIONS 240 #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
241 decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>())) 241 decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
242 inline _LIBCPP_INLINE_VISIBILITY 242 inline _LIBCPP_INLINE_VISIBILITY
243 __mb_cur_max_l(locale_t __l) 243 __mb_cur_max_l(locale_t __l)
244 { 244 {
245 return MB_CUR_MAX_L(__l); 245 return MB_CUR_MAX_L(__l);
246 } 246 }
247 #else // _LIBCPP_LOCALE__L_EXTENSIONS 247 #else // _LIBCPP_LOCALE__L_EXTENSIONS
248 inline _LIBCPP_ALWAYS_INLINE 248 inline _LIBCPP_ALWAYS_INLINE
(...skipping 4215 matching lines...) Expand 10 before | Expand all | Expand 10 after
4464 __rt = this; 4464 __rt = this;
4465 if ((__cm_ & ios_base::out) && sync()) 4465 if ((__cm_ & ios_base::out) && sync())
4466 __rt = 0; 4466 __rt = 0;
4467 } 4467 }
4468 return __rt; 4468 return __rt;
4469 } 4469 }
4470 4470
4471 _LIBCPP_END_NAMESPACE_STD 4471 _LIBCPP_END_NAMESPACE_STD
4472 4472
4473 #endif // _LIBCPP_LOCALE 4473 #endif // _LIBCPP_LOCALE
OLDNEW
« no previous file with comments | « include/__locale ('k') | include/support/musl/xlocale.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698