blob: b060f7568e00689d585a70f0b5c54d9f58808912 [file] [log] [blame]
Ben Craigfc1962d2016-05-20 12:58:41 +00001// -*- C++ -*-
2//===-------------- support/xlocale/__strtonum_fallback.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// These are reimplementations of some extended locale functions ( *_l ) that
11// aren't part of POSIX. They are widely available though (GLIBC, BSD, maybe
12// others). The unifying aspect in this case is that all of these functions
13// convert strings to some numeric type.
14//===----------------------------------------------------------------------===//
15
16#ifndef _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
17#define _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22inline _LIBCPP_ALWAYS_INLINE long double strtold_l(const char *nptr,
23 char **endptr, locale_t) {
24 return ::strtold(nptr, endptr);
25}
26
27inline _LIBCPP_ALWAYS_INLINE long long
28strtoll_l(const char *nptr, char **endptr, int base, locale_t) {
29 return ::strtoll(nptr, endptr, base);
30}
31
32inline _LIBCPP_ALWAYS_INLINE unsigned long long
33strtoull_l(const char *nptr, char **endptr, int base, locale_t) {
34 return ::strtoull(nptr, endptr, base);
35}
36
37inline _LIBCPP_ALWAYS_INLINE long long
38wcstoll_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
39 return ::wcstoll(nptr, endptr, base);
40}
41
42inline _LIBCPP_ALWAYS_INLINE unsigned long long
43wcstoull_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
44 return ::wcstoull(nptr, endptr, base);
45}
46
47inline _LIBCPP_ALWAYS_INLINE long double wcstold_l(const wchar_t *nptr,
48 wchar_t **endptr, locale_t) {
49 return ::wcstold(nptr, endptr);
50}
51
52#ifdef __cplusplus
53}
54#endif
55
56#endif // _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H