Path: blob/main/system/lib/llvm-libc/src/wchar/btowc.cpp
6171 views
//===-- Implementation of btowc -------------------------------------------===//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/btowc.h"9#include "src/__support/common.h"10#include "src/__support/macros/config.h"11#include "src/__support/wctype_utils.h"1213#include "hdr/types/wint_t.h"14#include "hdr/wchar_macros.h" // for WEOF.1516namespace LIBC_NAMESPACE_DECL {1718LLVM_LIBC_FUNCTION(wint_t, btowc, (int c)) {19auto result = internal::btowc(c);20if (result.has_value()) {21return result.value();22} else {23return WEOF;24}25}2627} // namespace LIBC_NAMESPACE_DECL282930