cuchar 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 <__config>
  29. #include <uchar.h>
  30. #ifndef _LIBCPP_UCHAR_H
  31. # error <cuchar> tried including <uchar.h> but didn't find libc++'s <uchar.h> header. \
  32. This usually means that your header search paths are not configured properly. \
  33. The header search paths should contain the C++ Standard Library headers before \
  34. any C Standard Library, and you are probably using compiler flags that make that \
  35. not be the case.
  36. #endif
  37. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  38. # pragma GCC system_header
  39. #endif
  40. _LIBCPP_BEGIN_NAMESPACE_STD
  41. #if !defined(_LIBCPP_CXX03_LANG)
  42. using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
  43. using ::size_t _LIBCPP_USING_IF_EXISTS;
  44. # if !defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8)
  45. using ::mbrtoc8 _LIBCPP_USING_IF_EXISTS;
  46. using ::c8rtomb _LIBCPP_USING_IF_EXISTS;
  47. # endif
  48. using ::mbrtoc16 _LIBCPP_USING_IF_EXISTS;
  49. using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
  50. using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS;
  51. using ::c32rtomb _LIBCPP_USING_IF_EXISTS;
  52. #endif // _LIBCPP_CXX03_LANG
  53. _LIBCPP_END_NAMESPACE_STD
  54. #endif // _LIBCPP_CUCHAR