From: Javier Martinez Canillas Date: Mon, 24 May 2021 17:40:04 +0000 (+0200) Subject: types: Define PRI{x,d}GRUB_INT{32,64}_T format specifiers X-Git-Tag: grub-2.06~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af54062b544ece06073d4a5eead48567bbccb81c;p=thirdparty%2Fgrub.git 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 --- 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;