aboutsummaryrefslogtreecommitdiffstats
path: root/include/inttypes.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-10-16 19:11:31 +0200
committerMattias Andrée <maandree@operamail.com>2015-10-16 19:11:31 +0200
commit50e120e73e471aad313e11ea57733316e616aa88 (patch)
tree4c4d9362e3da928f04ec50d28eaaacfc23dddf9b /include/inttypes.h
parentwhitespace (diff)
downloadslibc-50e120e73e471aad313e11ea57733316e616aa88.tar.gz
slibc-50e120e73e471aad313e11ea57733316e616aa88.tar.bz2
slibc-50e120e73e471aad313e11ea57733316e616aa88.tar.xz
do not assume that size(void*) == size(long)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'include/inttypes.h')
-rw-r--r--include/inttypes.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/inttypes.h b/include/inttypes.h
index d9e40e9..4dffb86 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -88,8 +88,19 @@ intmax_t imaxabs(intmax_t)
#define __PRIMAX "j"
#define __SCNMAX "j"
-#define __PRIPTR "l"
-#define __SCNPTR "l"
+#if __PTR_BIT == 8
+# define __PRIPTR __PRI8
+# define __SCNPTR __SCN8
+#elif __PTR_BIT == 16
+# define __PRIPTR __PRI16
+# define __SCNPTR __SCN16
+#elif __PTR_BIT == 32
+# define __PRIPTR __PRI32
+# define __SCNPTR __SCN32
+#elif __PTR_BIT == 64
+# define __PRIPTR __PRI64
+# define __SCNPTR __SCN64
+#endif