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

Side by Side Diff: include/support/musl/xlocale.h

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') | src/locale.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // -*- C++ -*-
2 //===------------------- support/musl/xlocale.h ------------------------===//
3 //
4 // The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10 // This adds support for the extended locale functions that are currently
11 // missing from the Musl C library.
12 //
13 // This only works when the specified locale is "C" or "POSIX", but that's
14 // about as good as we can do without implementing full xlocale support
15 // in Musl.
16 //===----------------------------------------------------------------------===//
17
18 #ifndef _LIBCPP_SUPPORT_MUSL_XLOCALE_H
19 #define _LIBCPP_SUPPORT_MUSL_XLOCALE_H
20
21 #include <cstdlib>
22 #include <cwchar>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 static inline long long strtoll_l(const char *nptr, char **endptr, int base,
29 locale_t) {
30 return strtoll(nptr, endptr, base);
31 }
32
33 static inline unsigned long long strtoull_l(const char *nptr, char **endptr,
34 int base, locale_t) {
35 return strtoull(nptr, endptr, base);
36 }
37
38 static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr,
39 int base, locale_t) {
40 return wcstoll(nptr, endptr, base);
41 }
42
43 static inline unsigned long long wcstoull_l(const wchar_t *nptr,
44 wchar_t **endptr, int base,
45 locale_t) {
46 return wcstoull(nptr, endptr, base);
47 }
48
49 static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr,
50 locale_t) {
51 return wcstold(nptr, endptr);
52 }
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif // _LIBCPP_SUPPORT_MUSL_XLOCALE_H
OLDNEW
« no previous file with comments | « include/locale ('k') | src/locale.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698