panloader-util.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * © Copyright 2017 The BiOpenly Community
  3. *
  4. * This program is free software and is provided to you under the terms of the
  5. * GNU General Public License version 2 as published by the Free Software
  6. * Foundation, and any use by you of this program is subject to the terms
  7. * of such GNU licence.
  8. *
  9. * A copy of the licence is included with the program, and can also be obtained
  10. * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  11. * Boston, MA 02110-1301, USA.
  12. *
  13. */
  14. /**
  15. * Miscellanious utilities
  16. */
  17. #ifndef __PANLOADER_UTIL_H__
  18. #define __PANLOADER_UTIL_H__
  19. #include <inttypes.h>
  20. typedef uint8_t u8;
  21. typedef uint16_t u16;
  22. typedef uint32_t u32;
  23. typedef uint64_t u64;
  24. typedef int8_t s8;
  25. typedef int16_t s16;
  26. typedef int32_t s32;
  27. typedef int64_t s64;
  28. #define ASSERT_SIZEOF_TYPE(type__, size__) \
  29. _Static_assert(sizeof(type__) == size__, \
  30. #type__ " does not match expected size " #size__)
  31. #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
  32. #define YES_NO(b) ((b) ? "Yes" : "No")
  33. #endif /* __PANLOADER_UTIL_H__ */