Path: blob/main/system/lib/llvm-libc/src/wchar/wcstol.cpp
6174 views
//===-- Implementation of wcstol ------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "src/wchar/wcstol.h"9#include "src/__support/common.h"10#include "src/__support/libc_errno.h"11#include "src/__support/macros/config.h"12#include "src/__support/wcs_to_integer.h"1314namespace LIBC_NAMESPACE_DECL {1516LLVM_LIBC_FUNCTION(long, wcstol,17(const wchar_t *__restrict str, wchar_t **__restrict str_end,18int base)) {19auto result = internal::wcstointeger<long>(str, base);20if (result.has_error())21libc_errno = result.error;2223if (str_end != nullptr)24*str_end = const_cast<wchar_t *>(str + result.parsed_len);2526return result;27}2829} // namespace LIBC_NAMESPACE_DECL303132