xref: /freebsd-src/contrib/llvm-project/libcxx/include/uchar.h (revision cb14a3fe5122c879eae1fb480ed7ce82a699ddb6)
181ad6265SDimitry Andric // -*- C++ -*-
281ad6265SDimitry Andric //===----------------------------------------------------------------------===//
381ad6265SDimitry Andric //
481ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
581ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
681ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
781ad6265SDimitry Andric //
881ad6265SDimitry Andric //===----------------------------------------------------------------------===//
981ad6265SDimitry Andric 
1081ad6265SDimitry Andric #ifndef _LIBCPP_UCHAR_H
1181ad6265SDimitry Andric #define _LIBCPP_UCHAR_H
1281ad6265SDimitry Andric 
1381ad6265SDimitry Andric /*
1481ad6265SDimitry Andric     uchar.h synopsis // since C++11
1581ad6265SDimitry Andric 
1681ad6265SDimitry Andric Macros:
1781ad6265SDimitry Andric 
1881ad6265SDimitry Andric     __STDC_UTF_16__
1981ad6265SDimitry Andric     __STDC_UTF_32__
2081ad6265SDimitry Andric 
2181ad6265SDimitry Andric Types:
2281ad6265SDimitry Andric 
2381ad6265SDimitry Andric   mbstate_t
2481ad6265SDimitry Andric   size_t
2581ad6265SDimitry Andric 
26bdd1243dSDimitry Andric size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps);     // since C++20
27bdd1243dSDimitry Andric size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps);                       // since C++20
2881ad6265SDimitry Andric size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps);
2981ad6265SDimitry Andric size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps);
3081ad6265SDimitry Andric size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps);
3181ad6265SDimitry Andric size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
3281ad6265SDimitry Andric 
3381ad6265SDimitry Andric */
3481ad6265SDimitry Andric 
3581ad6265SDimitry Andric #include <__config>
3681ad6265SDimitry Andric 
3781ad6265SDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
3881ad6265SDimitry Andric #  pragma GCC system_header
3981ad6265SDimitry Andric #endif
4081ad6265SDimitry Andric 
4181ad6265SDimitry Andric #if !defined(_LIBCPP_CXX03_LANG)
4281ad6265SDimitry Andric 
4381ad6265SDimitry Andric // Some platforms don't implement <uchar.h> and we don't want to give a hard
4481ad6265SDimitry Andric // error on those platforms. When the platform doesn't provide <uchar.h>, at
45*06c3fb27SDimitry Andric // least include <stddef.h> so we get the declaration for size_t, and try to
46*06c3fb27SDimitry Andric // get the declaration of mbstate_t too.
4781ad6265SDimitry Andric #  if __has_include_next(<uchar.h>)
4881ad6265SDimitry Andric #    include_next <uchar.h>
4981ad6265SDimitry Andric #  else
50*06c3fb27SDimitry Andric #    include <__mbstate_t.h>
5181ad6265SDimitry Andric #    include <stddef.h>
5281ad6265SDimitry Andric #  endif
5381ad6265SDimitry Andric 
5481ad6265SDimitry Andric #endif // _LIBCPP_CXX03_LANG
5581ad6265SDimitry Andric 
5681ad6265SDimitry Andric #endif // _LIBCPP_UCHAR_H
57