diff options
Diffstat (limited to 'firmware/libc')
-rw-r--r-- | firmware/libc/include/inttypes.h | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/firmware/libc/include/inttypes.h b/firmware/libc/include/inttypes.h index c03609c6d8..ff4027f17c 100644 --- a/firmware/libc/include/inttypes.h +++ b/firmware/libc/include/inttypes.h | |||
@@ -24,6 +24,78 @@ | |||
24 | 24 | ||
25 | #include <stdint.h> | 25 | #include <stdint.h> |
26 | 26 | ||
27 | /* could possibly have (f)printf format specifies here */ | 27 | /* could possibly have (f)scanf format specifiers here */ |
28 | |||
29 | /* 8 bit */ | ||
30 | #define PRId8 "d" | ||
31 | #define PRIi8 "d" | ||
32 | #define PRIu8 "u" | ||
33 | #define PRIx8 "x" | ||
34 | #define PRIX8 "X" | ||
35 | |||
36 | /* 16 bit */ | ||
37 | #if USHRT_MAX == 0xffff | ||
38 | |||
39 | #define PRId16 "d" | ||
40 | #define PRIi16 "d" | ||
41 | #define PRIu16 "u" | ||
42 | #define PRIx16 "x" | ||
43 | #define PRIX16 "X" | ||
44 | |||
45 | #endif | ||
46 | |||
47 | /* 32 bit */ | ||
48 | #if ULONG_MAX == 0xfffffffful | ||
49 | |||
50 | #define PRId32 "ld" | ||
51 | #define PRIi32 "ld" | ||
52 | #define PRIu32 "lu" | ||
53 | #define PRIx32 "lx" | ||
54 | #define PRIX32 "lX" | ||
55 | #define PRIdPTR "ld" | ||
56 | #define PRIiPTR "ld" | ||
57 | #define PRIuPTR "lu" | ||
58 | #define PRIxPTR "lx" | ||
59 | #define PRIXPTR "lX" | ||
60 | |||
61 | #elif UINT_MAX == 0xffffffffu | ||
62 | |||
63 | #define PRId32 "d" | ||
64 | #define PRIi32 "d" | ||
65 | #define PRIu32 "u" | ||
66 | #define PRIx32 "x" | ||
67 | #define PRIX32 "X" | ||
68 | |||
69 | #endif | ||
70 | |||
71 | /* 64 bit */ | ||
72 | #if ULONG_MAX == 0xffffffffffffffffull | ||
73 | |||
74 | #define PRId64 "ld" | ||
75 | #define PRIi64 "ld" | ||
76 | #define PRIu64 "lu" | ||
77 | #define PRIx64 "lx" | ||
78 | #define PRIX64 "lX" | ||
79 | #define PRIdPTR "ld" | ||
80 | #define PRIiPTR "ld" | ||
81 | #define PRIuPTR "lu" | ||
82 | #define PRIxPTR "lx" | ||
83 | #define PRIXPTR "lX" | ||
84 | |||
85 | |||
86 | #else | ||
87 | |||
88 | #define PRId64 "lld" | ||
89 | #define PRIi64 "lld" | ||
90 | #define PRIu64 "llu" | ||
91 | #define PRIx64 "llx" | ||
92 | #define PRIX64 "llX" | ||
93 | #define PRIdPTR "lld" | ||
94 | #define PRIiPTR "lld" | ||
95 | #define PRIuPTR "llu" | ||
96 | #define PRIxPTR "llx" | ||
97 | #define PRIXPTR "llX" | ||
98 | |||
99 | #endif | ||
28 | 100 | ||
29 | #endif /* __INTTYPES_H__ */ | 101 | #endif /* __INTTYPES_H__ */ |