From 13d4161b455bcca4156f82005f00f65457cc8ed0 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 17 Aug 2016 02:00:21 -0400 Subject: [PATCH] Fill in missing PRI* macros for inttypes.h. inttypes.h is supposed to define print macros for the various integers defined in stdint.h. This change fills in the sized macros for all the various suffixes. The 'o' suffixed variants are omitted because, at a glance, lib/libc/printf.c does not support it. Note to reviewers, these should be checked against the typedefs in stdint.h and the prefixes defined for this libc's printf implementing. Change-Id: I71a9425854f05a2c189389dea53a5748d3c1dd2d --- lib/libc/include/inttypes.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/libc/include/inttypes.h b/lib/libc/include/inttypes.h index 4e542d4a..7bb0b894 100644 --- a/lib/libc/include/inttypes.h +++ b/lib/libc/include/inttypes.h @@ -23,8 +23,29 @@ #ifndef __INTTYPES_H #define __INTTYPES_H +#define PRId8 "hhd" +#define PRIi8 "hhi" +#define PRIu8 "hhu" +#define PRIx8 "hhx" +#define PRIX8 "hhX" + +#define PRId16 "hd" +#define PRIi16 "hi" +#define PRIu16 "hu" +#define PRIx16 "hx" +#define PRIX16 "hX" + +#define PRId32 "d" +#define PRIi32 "i" #define PRIu32 "u" #define PRIx32 "x" +#define PRIX32 "X" + +#define PRId64 "lld" +#define PRIi64 "lli" +#define PRIu64 "llu" +#define PRIx64 "llx" +#define PRIX64 "llX" #include