unitypes.in.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Elementary types and macros for the GNU UniString library.
  2. Copyright (C) 2002, 2005-2006, 2009-2014 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify it
  4. under the terms of the GNU Lesser General Public License as published
  5. by the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. #ifndef _UNITYPES_H
  14. #define _UNITYPES_H
  15. /* Get uint8_t, uint16_t, uint32_t. */
  16. #include <stdint.h>
  17. /* Type representing a Unicode character. */
  18. typedef uint32_t ucs4_t;
  19. /* Attribute of a function whose result depends only on the arguments
  20. (not pointers!) and which has no side effects. */
  21. #ifndef _UC_ATTRIBUTE_CONST
  22. # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
  23. # define _UC_ATTRIBUTE_CONST __attribute__ ((__const__))
  24. # else
  25. # define _UC_ATTRIBUTE_CONST
  26. # endif
  27. #endif
  28. /* Attribute of a function whose result depends only on the arguments
  29. (possibly pointers) and global memory, and which has no side effects. */
  30. #ifndef _UC_ATTRIBUTE_PURE
  31. # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
  32. # define _UC_ATTRIBUTE_PURE __attribute__ ((__pure__))
  33. # else
  34. # define _UC_ATTRIBUTE_PURE
  35. # endif
  36. #endif
  37. #endif /* _UNITYPES_H */