1 // -*- C++ -*-
2 //===-----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 // These are reimplementations of some extended locale functions ( *_l ) that
10 // aren't part of POSIX. They are widely available though (GLIBC, BSD, maybe
11 // others). The unifying aspect in this case is that all of these functions
12 // convert strings to some numeric type.
13 //===----------------------------------------------------------------------===//
14
15 #ifndef _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
16 #define _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 inline _LIBCPP_HIDE_FROM_ABI float
strtof_l(const char * __nptr,char ** __endptr,locale_t)23 strtof_l(const char *__nptr, char **__endptr, locale_t) {
24 return ::strtof(__nptr, __endptr);
25 }
26
27 inline _LIBCPP_HIDE_FROM_ABI double
strtod_l(const char * __nptr,char ** __endptr,locale_t)28 strtod_l(const char *__nptr, char **__endptr, locale_t) {
29 return ::strtod(__nptr, __endptr);
30 }
31
32 inline _LIBCPP_HIDE_FROM_ABI long double
strtold_l(const char * __nptr,char ** __endptr,locale_t)33 strtold_l(const char *__nptr, char **__endptr, locale_t) {
34 return ::strtold(__nptr, __endptr);
35 }
36
37 inline _LIBCPP_HIDE_FROM_ABI long long
strtoll_l(const char * __nptr,char ** __endptr,int __base,locale_t)38 strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
39 return ::strtoll(__nptr, __endptr, __base);
40 }
41
42 inline _LIBCPP_HIDE_FROM_ABI unsigned long long
strtoull_l(const char * __nptr,char ** __endptr,int __base,locale_t)43 strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
44 return ::strtoull(__nptr, __endptr, __base);
45 }
46
47 inline _LIBCPP_HIDE_FROM_ABI long long
wcstoll_l(const wchar_t * __nptr,wchar_t ** __endptr,int __base,locale_t)48 wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
49 return ::wcstoll(__nptr, __endptr, __base);
50 }
51
52 inline _LIBCPP_HIDE_FROM_ABI unsigned long long
wcstoull_l(const wchar_t * __nptr,wchar_t ** __endptr,int __base,locale_t)53 wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
54 return ::wcstoull(__nptr, __endptr, __base);
55 }
56
57 inline _LIBCPP_HIDE_FROM_ABI long double
wcstold_l(const wchar_t * __nptr,wchar_t ** __endptr,locale_t)58 wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
59 return ::wcstold(__nptr, __endptr);
60 }
61
62 #ifdef __cplusplus
63 }
64 #endif
65
66 #endif // _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
67