|
| 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 | + |
| 10 | +#ifndef _LIBCPP___CHARCONV_FROM_CHARS_FLOATING_POINT_H |
| 11 | +#define _LIBCPP___CHARCONV_FROM_CHARS_FLOATING_POINT_H |
| 12 | + |
| 13 | +#include <__assert> |
| 14 | +#include <__charconv/chars_format.h> |
| 15 | +#include <__charconv/from_chars_result.h> |
| 16 | +#include <__config> |
| 17 | + |
| 18 | +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 19 | +# pragma GCC system_header |
| 20 | +#endif |
| 21 | + |
| 22 | +_LIBCPP_PUSH_MACROS |
| 23 | +#include <__undef_macros> |
| 24 | + |
| 25 | +_LIBCPP_BEGIN_NAMESPACE_STD |
| 26 | + |
| 27 | +#if _LIBCPP_STD_VER >= 17 |
| 28 | + |
| 29 | +_LIBCPP_EXPORTED_FROM_ABI from_chars_result |
| 30 | +__from_chars_floating_point(const char* __first, const char* __last, float& __value, chars_format __fmt); |
| 31 | + |
| 32 | +_LIBCPP_EXPORTED_FROM_ABI from_chars_result |
| 33 | +__from_chars_floating_point(const char* __first, const char* __last, double& __value, chars_format __fmt); |
| 34 | + |
| 35 | +_LIBCPP_AVAILABILITY_FROM_CHARS_FLOATING_POINT _LIBCPP_HIDE_FROM_ABI inline from_chars_result |
| 36 | +from_chars(const char* __first, const char* __last, float& __value, chars_format __fmt = chars_format::general) { |
| 37 | + return std::__from_chars_floating_point(__first, __last, __value, __fmt); |
| 38 | +} |
| 39 | + |
| 40 | +_LIBCPP_AVAILABILITY_FROM_CHARS_FLOATING_POINT _LIBCPP_HIDE_FROM_ABI inline from_chars_result |
| 41 | +from_chars(const char* __first, const char* __last, double& __value, chars_format __fmt = chars_format::general) { |
| 42 | + return std::__from_chars_floating_point(__first, __last, __value, __fmt); |
| 43 | +} |
| 44 | + |
| 45 | +#endif // _LIBCPP_STD_VER >= 17 |
| 46 | + |
| 47 | +_LIBCPP_END_NAMESPACE_STD |
| 48 | + |
| 49 | +_LIBCPP_POP_MACROS |
| 50 | + |
| 51 | +#endif // _LIBCPP___CHARCONV_FROM_CHARS_FLOATING_POINT_H |
0 commit comments