Skip to content

Commit eb5c6d9

Browse files
committed
options/ansi: fix PRI*FAST macros for 32-bit platforms
1 parent 10c98f3 commit eb5c6d9

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

options/ansi/include/inttypes.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
#ifndef __MLIBC_ABI_ONLY
1010

1111
#if UINTPTR_MAX == UINT64_MAX
12+
# define __PRIFAST "l"
1213
# define __PRI64 "l"
1314
# define __PRIPTR "l"
1415
#else
16+
# define __PRIFAST ""
1517
# define __PRI64 "ll"
1618
# define __PRIPTR ""
1719
#endif
@@ -27,14 +29,14 @@
2729
#define PRIi16 "i"
2830
#define PRIdLEAST16 "d"
2931
#define PRIiLEAST16 "i"
30-
#define PRIdFAST16 "ld"
31-
#define PRIiFAST16 "li"
32+
#define PRIdFAST16 __PRIFAST "d"
33+
#define PRIiFAST16 __PRIFAST "i"
3234
#define PRId32 "d"
3335
#define PRIi32 "i"
3436
#define PRIdLEAST32 "d"
3537
#define PRIiLEAST32 "i"
36-
#define PRIdFAST32 "ld"
37-
#define PRIiFAST32 "li"
38+
#define PRIdFAST32 __PRIFAST "d"
39+
#define PRIiFAST32 __PRIFAST "i"
3840
#define PRId64 __PRI64 "d"
3941
#define PRIi64 __PRI64 "i"
4042
#define PRIdLEAST64 __PRI64 "d"
@@ -65,10 +67,10 @@
6567
#define PRIuLEAST16 "u"
6668
#define PRIxLEAST16 "x"
6769
#define PRIXLEAST16 "X"
68-
#define PRIoFAST16 "lo"
69-
#define PRIuFAST16 "lu"
70-
#define PRIxFAST16 "lx"
71-
#define PRIXFAST16 "lX"
70+
#define PRIoFAST16 __PRIFAST "o"
71+
#define PRIuFAST16 __PRIFAST "u"
72+
#define PRIxFAST16 __PRIFAST "x"
73+
#define PRIXFAST16 __PRIFAST "X"
7274
#define PRIo32 "o"
7375
#define PRIu32 "u"
7476
#define PRIx32 "x"
@@ -77,10 +79,10 @@
7779
#define PRIuLEAST32 "u"
7880
#define PRIxLEAST32 "x"
7981
#define PRIXLEAST32 "X"
80-
#define PRIoFAST32 "lo"
81-
#define PRIuFAST32 "lu"
82-
#define PRIxFAST32 "lx"
83-
#define PRIXFAST32 "lX"
82+
#define PRIoFAST32 __PRIFAST "o"
83+
#define PRIuFAST32 __PRIFAST "u"
84+
#define PRIxFAST32 __PRIFAST "x"
85+
#define PRIXFAST32 __PRIFAST "X"
8486
#define PRIo64 __PRI64 "o"
8587
#define PRIu64 __PRI64 "u"
8688
#define PRIx64 __PRI64 "x"

0 commit comments

Comments
 (0)