Types.h 800 B

123456789101112131415161718192021222324252627282930
  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 long u64;
  8. typedef char s8;
  9. typedef short s16;
  10. typedef int s32;
  11. typedef long long s64;
  12. typedef u32 size;
  13. static_assert(sizeof(u8) == 1, "u8 is not 8 bit");
  14. static_assert(sizeof(u16) == 2, "u16 is not 16 bit");
  15. static_assert(sizeof(u32) == 4, "u32 is not 32 bit");
  16. static_assert(sizeof(u64) == 8, "u64 is not 64 bit");
  17. static_assert(sizeof(s8) == 1, "s8 is not 8 bit");
  18. static_assert(sizeof(s16) == 2, "s16 is not 16 bit");
  19. static_assert(sizeof(s32) == 4, "s32 is not 64 bit");
  20. static_assert(sizeof(s64) == 8, "s64 is not 64 bit");
  21. static_assert(sizeof(size) == sizeof(nullptr), "size has not the same size as a nullpointer");
  22. #endif