0004-Define-GRUB_UINT32_MAX.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From c8c80f05753c26b7d7f5e3c3993039c565194875 Mon Sep 17 00:00:00 2001
  2. From: Ax333l <main@axelen.xyz>
  3. Date: Thu, 17 Aug 2023 00:00:00 +0000
  4. Subject: [PATCH 04/14] Define GRUB_UINT32_MAX
  5. Signed-off-by: Nicholas Johnson <nick@nicholasjohnson.ch>
  6. ---
  7. include/grub/types.h | 8 ++++++++
  8. 1 file changed, 8 insertions(+)
  9. diff --git a/include/grub/types.h b/include/grub/types.h
  10. index 45079bf65..8c0b30395 100644
  11. --- a/include/grub/types.h
  12. +++ b/include/grub/types.h
  13. @@ -156,6 +156,7 @@ typedef grub_int32_t grub_ssize_t;
  14. #define GRUB_SHRT_MAX 0x7fff
  15. #define GRUB_SHRT_MIN (-GRUB_SHRT_MAX - 1)
  16. #define GRUB_UINT_MAX 4294967295U
  17. +#define GRUB_UINT32_MAX 4294967295U
  18. #define GRUB_INT_MAX 0x7fffffff
  19. #define GRUB_INT_MIN (-GRUB_INT_MAX - 1)
  20. #define GRUB_INT32_MAX 2147483647
  21. @@ -177,6 +178,13 @@ typedef grub_int32_t grub_ssize_t;
  22. #define GRUB_TYPE_U_MAX(type) ((unsigned long long)((typeof (type))(~0)))
  23. #define GRUB_TYPE_U_MIN(type) 0ULL
  24. +# define GRUB_UINT32_C(x) x ## U
  25. +# if GRUB_ULONG_MAX >> 31 >> 31 >> 1 == 1
  26. +# define GRUB_UINT64_C(x) x##UL
  27. +# elif 1
  28. +# define GRUB_UINT64_C(x) x##ULL
  29. +# endif
  30. +
  31. typedef grub_uint64_t grub_properly_aligned_t;
  32. #define GRUB_PROPERLY_ALIGNED_ARRAY(name, size) grub_properly_aligned_t name[((size) + sizeof (grub_properly_aligned_t) - 1) / sizeof (grub_properly_aligned_t)]
  33. --
  34. 2.39.2