scalar_int_sized.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /// @ref ext_scalar_int_sized
  2. /// @file glm/ext/scalar_int_sized.hpp
  3. ///
  4. /// @defgroup ext_scalar_int_sized GLM_EXT_scalar_int_sized
  5. /// @ingroup ext
  6. ///
  7. /// Exposes sized signed integer scalar types.
  8. ///
  9. /// Include <glm/ext/scalar_int_sized.hpp> to use the features of this extension.
  10. ///
  11. /// @see ext_scalar_uint_sized
  12. #pragma once
  13. #include "../detail/setup.hpp"
  14. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  15. # pragma message("GLM: GLM_EXT_scalar_int_sized extension included")
  16. #endif
  17. namespace glm{
  18. namespace detail
  19. {
  20. # if GLM_HAS_EXTENDED_INTEGER_TYPE
  21. typedef std::int8_t int8;
  22. typedef std::int16_t int16;
  23. typedef std::int32_t int32;
  24. # else
  25. typedef signed char int8;
  26. typedef signed short int16;
  27. typedef signed int int32;
  28. #endif//
  29. template<>
  30. struct is_int<int8>
  31. {
  32. enum test {value = ~0};
  33. };
  34. template<>
  35. struct is_int<int16>
  36. {
  37. enum test {value = ~0};
  38. };
  39. template<>
  40. struct is_int<int64>
  41. {
  42. enum test {value = ~0};
  43. };
  44. }//namespace detail
  45. /// @addtogroup ext_scalar_int_sized
  46. /// @{
  47. /// 8 bit signed integer type.
  48. typedef detail::int8 int8;
  49. /// 16 bit signed integer type.
  50. typedef detail::int16 int16;
  51. /// 32 bit signed integer type.
  52. typedef detail::int32 int32;
  53. /// 64 bit signed integer type.
  54. typedef detail::int64 int64;
  55. /// @}
  56. }//namespace glm