[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libcxx / src / charconv.cpp
blobaa52220413aa2d9ab88474f39e3538416875d588
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include <charconv>
10 #include <string.h>
12 #include "include/to_chars_floating_point.h"
14 _LIBCPP_BEGIN_NAMESPACE_STD
16 #ifndef _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10
18 namespace __itoa
21 _LIBCPP_EXPORTED_FROM_ABI char*
22 __u32toa(uint32_t value, char* buffer) noexcept
24 return __base_10_u32(buffer, value);
27 _LIBCPP_EXPORTED_FROM_ABI char*
28 __u64toa(uint64_t value, char* buffer) noexcept
30 return __base_10_u64(buffer, value);
33 } // namespace __itoa
35 #endif // _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10
37 // The original version of floating-point to_chars was written by Microsoft and
38 // contributed with the following license.
40 // Copyright (c) Microsoft Corporation.
41 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
43 // This implementation is dedicated to the memory of Mary and Thavatchai.
45 to_chars_result to_chars(char* __first, char* __last, float __value) {
46 return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(__first, __last, __value, chars_format{}, 0);
49 to_chars_result to_chars(char* __first, char* __last, double __value) {
50 return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(__first, __last, __value, chars_format{}, 0);
53 to_chars_result to_chars(char* __first, char* __last, long double __value) {
54 return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(__first, __last, static_cast<double>(__value),
55 chars_format{}, 0);
58 to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt) {
59 return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>(__first, __last, __value, __fmt, 0);
62 to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt) {
63 return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>(__first, __last, __value, __fmt, 0);
66 to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt) {
67 return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>(__first, __last, static_cast<double>(__value),
68 __fmt, 0);
71 to_chars_result to_chars(char* __first, char* __last, float __value, chars_format __fmt, int __precision) {
72 return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>(__first, __last, __value, __fmt,
73 __precision);
76 to_chars_result to_chars(char* __first, char* __last, double __value, chars_format __fmt, int __precision) {
77 return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>(__first, __last, __value, __fmt,
78 __precision);
81 to_chars_result to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision) {
82 return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>(
83 __first, __last, static_cast<double>(__value), __fmt, __precision);
86 _LIBCPP_END_NAMESPACE_STD