38 lines · c
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-exception7//8//===----------------------------------------------------------------------===//9// These are reimplementations of some extended locale functions ( *_l ) that10// aren't part of POSIX. They are widely available though (GLIBC, BSD, maybe11// others). The unifying aspect in this case is that all of these functions12// convert strings to some numeric type.13//===----------------------------------------------------------------------===//14 15#ifndef _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H16#define _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H17 18#include <__config>19#include <stdlib.h>20 21#if _LIBCPP_HAS_WIDE_CHARACTERS22# include <wchar.h>23#endif24 25inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) {26 return ::strtof(__nptr, __endptr);27}28 29inline _LIBCPP_HIDE_FROM_ABI double strtod_l(const char* __nptr, char** __endptr, locale_t) {30 return ::strtod(__nptr, __endptr);31}32 33inline _LIBCPP_HIDE_FROM_ABI long double strtold_l(const char* __nptr, char** __endptr, locale_t) {34 return ::strtold(__nptr, __endptr);35}36 37#endif // _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H38