Types.h 675 B

1234567891011121314151617181920212223242526
  1. #ifndef TYPES_H
  2. #define TYPES_H
  3. typedef unsigned int uint;
  4. typedef unsigned char u8;
  5. typedef unsigned short u16;
  6. typedef unsigned int u32;
  7. typedef unsigned long u64;
  8. static_assert(sizeof(u8) == 1, "u8 is not 8 bit");
  9. static_assert(sizeof(u16) == 2, "u16 is not 16 bit");
  10. static_assert(sizeof(u32) == 4, "u32 is not 32 bit");
  11. static_assert(sizeof(u64) == 8, "u64 is not 64 bit");
  12. typedef char s8;
  13. typedef short s16;
  14. typedef int s32;
  15. typedef long s64;
  16. static_assert(sizeof(s8) == 1, "s8 is not 8 bit");
  17. static_assert(sizeof(s16) == 2, "s16 is not 16 bit");
  18. static_assert(sizeof(s32) == 4, "s32 is not 32 bit");
  19. static_assert(sizeof(s64) == 8, "s64 is not 64 bit");
  20. #endif