From af54062b544ece06073d4a5eead48567bbccb81c Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 24 May 2021 19:40:04 +0200 Subject: [PATCH] types: Define PRI{x,d}GRUB_INT{32,64}_T format specifiers There are already PRI*_T constants defined for unsigned integers but not for signed integers. Add format specifiers for the latter. Suggested-by: Daniel Kiper Signed-off-by: Javier Martinez Canillas Reviewed-by: Daniel Kiper --- include/grub/types.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/grub/types.h b/include/grub/types.h index b36b26a79..0a3ff1591 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -86,10 +86,16 @@ typedef signed char grub_int8_t; typedef short grub_int16_t; typedef int grub_int32_t; +# define PRIxGRUB_INT32_T "x" +# define PRIdGRUB_INT32_T "d" #if GRUB_CPU_SIZEOF_LONG == 8 typedef long grub_int64_t; +# define PRIxGRUB_INT64_T "lx" +# define PRIdGRUB_INT64_T "ld" #else typedef long long grub_int64_t; +# define PRIxGRUB_INT64_T "llx" +# define PRIdGRUB_INT64_T "lld" #endif typedef unsigned char grub_uint8_t;