defs.h 762 B

1234567891011121314151617181920212223242526272829303132333435
  1. // UTF-16 core definitions
  2. //
  3. // Platform: ISO C++ 98/11
  4. // $Id$
  5. //
  6. // (c) __vic 2017
  7. #ifndef __VIC_UTF16_DEFS_H
  8. #define __VIC_UTF16_DEFS_H
  9. #include<__vic/defs.h>
  10. #if !__cpp_unicode_characters
  11. #include<__vic/stdint.h>
  12. #endif
  13. namespace __vic { namespace utf16 {
  14. // UTF-16 code unit type
  15. #if __cpp_unicode_characters
  16. typedef char16_t code_unit_t;
  17. #else
  18. typedef uint_least16_t code_unit_t;
  19. #endif
  20. // Leading (high) surrogates
  21. __VIC_INLINE_CONSTEXPR_VAR code_unit_t hi_surrogate_min = 0xD800,
  22. hi_surrogate_max = 0xDBFF;
  23. // Trailing (low) surrogates
  24. __VIC_INLINE_CONSTEXPR_VAR code_unit_t lo_surrogate_min = 0xDC00,
  25. lo_surrogate_max = 0xDFFF;
  26. }} // namespace
  27. #endif // header guard