uchar.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. /* ISO C1x Unicode utilities
  7. * Based on ISO/IEC SC22/WG14 9899 TR 19769 (SC22 N1326)
  8. *
  9. * THIS SOFTWARE IS NOT COPYRIGHTED
  10. *
  11. * This source code is offered for use in the public domain. You may
  12. * use, modify or distribute it freely.
  13. *
  14. * This code is distributed in the hope that it will be useful but
  15. * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  16. * DISCLAIMED. This includes but is not limited to warranties of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. *
  19. * Date: 2011-09-27
  20. */
  21. #ifndef __UCHAR_H
  22. #define __UCHAR_H
  23. #include <stddef.h> /* size_t */
  24. #include <stdint.h> /* uint_leastXX_t */
  25. #include <wchar.h> /* mbstate_t */
  26. /* Remember that g++ >= 4.4 defines these types only in c++0x mode */
  27. #if !(defined(__cplusplus) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
  28. !defined(__GNUC__) || \
  29. (!defined(__clang__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)))
  30. typedef uint_least16_t char16_t;
  31. typedef uint_least32_t char32_t;
  32. #endif
  33. #ifndef __STDC_UTF_16__
  34. #define __STDC_UTF_16__ 1
  35. #endif
  36. #ifndef __STDC_UTF_32__
  37. #define __STDC_UTF_32__ 1
  38. #endif
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. size_t mbrtoc16 (char16_t *__restrict__ pc16,
  43. const char *__restrict__ s,
  44. size_t n,
  45. mbstate_t *__restrict__ ps);
  46. size_t c16rtomb (char *__restrict__ s,
  47. char16_t c16,
  48. mbstate_t *__restrict__ ps);
  49. size_t mbrtoc32 (char32_t *__restrict__ pc32,
  50. const char *__restrict__ s,
  51. size_t n,
  52. mbstate_t *__restrict__ ps);
  53. size_t c32rtomb (char *__restrict__ s,
  54. char32_t c32,
  55. mbstate_t *__restrict__ ps);
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif /* __UCHAR_H */