2 //===----------------------------------------------------------------------===//
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
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_CUCHAR
11 #define _LIBCPP_CUCHAR
14 cuchar synopsis // since C++11
28 size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps); // since C++20
29 size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps); // since C++20
30 size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps);
31 size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps);
32 size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps);
33 size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
39 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
40 # include <__cxx03/cuchar>
43 # include <__cstddef/size_t.h>
47 # ifndef _LIBCPP_UCHAR_H
48 # error <cuchar> tried including <uchar.h> but didn't find libc++'s <uchar.h> header. \
49 This usually means that your header search paths are not configured properly. \
50 The header search paths should contain the C++ Standard Library headers before \
51 any C Standard Library, and you are probably using compiler flags that make that \
55 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
56 # pragma GCC system_header
59 _LIBCPP_BEGIN_NAMESPACE_STD
61 # if !defined(_LIBCPP_CXX03_LANG)
63 using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
65 # if _LIBCPP_HAS_C8RTOMB_MBRTOC8
66 using ::mbrtoc8 _LIBCPP_USING_IF_EXISTS;
67 using ::c8rtomb _LIBCPP_USING_IF_EXISTS;
69 using ::mbrtoc16 _LIBCPP_USING_IF_EXISTS;
70 using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
71 using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;
72 using ::c32rtomb _LIBCPP_USING_IF_EXISTS;
74 # endif // _LIBCPP_CXX03_LANG
76 _LIBCPP_END_NAMESPACE_STD
78 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
80 #endif // _LIBCPP_CUCHAR