[libc++] Make to_chars base 10 header only.
The functions to_chars and from_chars should offer 128-bit support. This
is the first step to implement 128-bit version of to_chars. Before
implementing 128-bit support the current code will be polished.
This moves the code from the dylib to the header in prepartion of
P2291 "Add Constexpr Modifiers to Functions to_chars and from_chars for
Integral Types in <charconv> Header"
Note some more cleanups will be done in follow-up commits
- Remove the _LIBCPP_AVAILABILITY_TO_CHARS from to_chars. With all code
in the header the availablilty macro is no longer needed. This
requires enabling the unit tests for additional platforms.
- The code in the dylib can switch to using the header implementation.
This allows removing the code duplicated in the header and the dylib.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D125704
NOKEYCHECK=True
GitOrigin-RevId: a15ae4139ceaa03c74089b727d91e39e772a94fb
diff --git a/src/charconv.cpp b/src/charconv.cpp
index 9537b42..2e5e809 100644
--- a/src/charconv.cpp
+++ b/src/charconv.cpp
@@ -85,7 +85,7 @@
return buffer;
}
-char*
+_LIBCPP_FUNC_VIS char*
__u32toa(uint32_t value, char* buffer) noexcept
{
if (value < 100000000)
@@ -106,7 +106,7 @@
return buffer;
}
-char*
+_LIBCPP_FUNC_VIS char*
__u64toa(uint64_t value, char* buffer) noexcept
{
if (value < 100000000)