grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/6] types.h: add UINT-related macros needed for Argon2


From: Daniel Kiper
Subject: Re: [PATCH v2 2/6] types.h: add UINT-related macros needed for Argon2
Date: Fri, 21 Feb 2020 13:34:49 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Thu, Feb 20, 2020 at 07:00:50PM +0100, Patrick Steinhardt wrote:
> For the upcoming import of the Argon2 library, we need the macros
> GRUB_UINT32_MAX, GRUB_UINT32_C and GRUB_UINT64_C. Add them as a
> preparatory step.
>
> Signed-off-by: Patrick Steinhardt <address@hidden>
> ---
>  include/grub/types.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/include/grub/types.h b/include/grub/types.h
> index 035a4b528..35ba900dd 100644
> --- a/include/grub/types.h
> +++ b/include/grub/types.h
> @@ -137,6 +137,7 @@ typedef grub_int32_t      grub_ssize_t;
>  #define GRUB_SHRT_MAX 0x7fff
>  #define GRUB_SHRT_MIN (-GRUB_SHRT_MAX - 1)
>  #define GRUB_UINT_MAX 4294967295U
> +#define GRUB_UINT32_MAX 4294967295U
>  #define GRUB_INT_MAX 0x7fffffff
>  #define GRUB_INT_MIN (-GRUB_INT_MAX - 1)
>  #define GRUB_INT32_MAX 2147483647
> @@ -151,6 +152,13 @@ typedef grub_int32_t     grub_ssize_t;
>  #endif
>  # define GRUB_LONG_MIN (-GRUB_LONG_MAX - 1)
>
> +# define GRUB_UINT32_C(x) x ## U
> +# if GRUB_ULONG_MAX >> 31 >> 31 >> 1 == 1
> +#  define GRUB_UINT64_C(x) x##UL
> +# elif 1

#else?

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]