cuchar 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef _LIBCPP_CUCHAR
  10. #define _LIBCPP_CUCHAR
  11. /*
  12. cuchar synopsis // since C++11
  13. Macros:
  14. __STDC_UTF_16__
  15. __STDC_UTF_32__
  16. namespace std {
  17. Types:
  18. mbstate_t
  19. size_t
  20. size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps); // since C++20
  21. size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps); // since C++20
  22. size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps);
  23. size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps);
  24. size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps);
  25. size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);
  26. } // std
  27. */
  28. #include <__assert> // all public C++ headers provide the assertion handler
  29. #include <__config>
  30. #include <uchar.h>
  31. #ifndef _LIBCPP_UCHAR_H
  32. # error <cuchar> tried including <uchar.h> but didn't find libc++'s <uchar.h> header. \
  33. This usually means that your header search paths are not configured properly. \
  34. The header search paths should contain the C++ Standard Library headers before \
  35. any C Standard Library, and you are probably using compiler flags that make that \
  36. not be the case.
  37. #endif
  38. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  39. # pragma GCC system_header
  40. #endif
  41. _LIBCPP_BEGIN_NAMESPACE_STD
  42. #if !defined(_LIBCPP_CXX03_LANG)
  43. using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
  44. using ::size_t _LIBCPP_USING_IF_EXISTS;
  45. # if !defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8)
  46. using ::mbrtoc8 _LIBCPP_USING_IF_EXISTS;
  47. using ::c8rtomb _LIBCPP_USING_IF_EXISTS;
  48. # endif
  49. using ::mbrtoc16 _LIBCPP_USING_IF_EXISTS;
  50. using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
  51. using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;
  52. using ::c32rtomb _LIBCPP_USING_IF_EXISTS;
  53. #endif // _LIBCPP_CXX03_LANG
  54. _LIBCPP_END_NAMESPACE_STD
  55. #endif // _LIBCPP_CUCHAR