aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2016-08-17 02:00:21 -0400
committerArve Hjønnevåg <arve@android.com>2017-09-19 16:38:28 -0700
commitd93c7dc1631bf50c2c7e841efcc7283483de6900 (patch)
tree63d067aa9fa349532277d3f60f1f22e32aff99ae
parent92a0b0fde6882627dc16aeb420ca6030e29de351 (diff)
downloadcommon-d93c7dc1631bf50c2c7e841efcc7283483de6900.tar.gz
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
-rw-r--r--lib/libc/include/inttypes.h21
1 files changed, 21 insertions, 0 deletions
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 <stdint.h>