printf: fix printf "%u\n" +18446744073709551614
[oweals/busybox.git] / include / platform.h
index ea49c7e9251ecef704753616bb2491e4cd730940..c365d5c8c15e4014a96fccc66e6a2c12769d14fd 100644 (file)
@@ -260,6 +260,11 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING;
 #define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val))
 #define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val))
 
+/* unxz needs an aligned fixed-endian accessor.
+ * (however, the compiler does not realize it's aligned, the cast is still necessary)
+ */
+#define get_le32(u32p) ({ uint32_t v = *(bb__aliased_uint32_t*)(u32p); SWAP_LE32(v); })
+
 
 /* ---- Size-saving "small" ints (arch-dependent) ----------- */
 
@@ -406,6 +411,7 @@ typedef unsigned smalluint;
 #define HAVE_MNTENT_H 1
 #define HAVE_NET_ETHERNET_H 1
 #define HAVE_SYS_STATFS_H 1
+#define HAVE_PRINTF_PERCENTM 1
 
 #if defined(__UCLIBC__)
 # if UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32)
@@ -461,6 +467,7 @@ typedef unsigned smalluint;
 # undef HAVE_DPRINTF
 # undef HAVE_UNLOCKED_STDIO
 # undef HAVE_UNLOCKED_LINE_OPS
+# undef HAVE_PRINTF_PERCENTM
 #endif
 
 #if defined(__dietlibc__)
@@ -483,6 +490,7 @@ typedef unsigned smalluint;
 # undef HAVE_STRVERSCMP
 # undef HAVE_XTABS
 # undef HAVE_UNLOCKED_LINE_OPS
+# undef HAVE_PRINTF_PERCENTM
 # include <osreldate.h>
 # if __FreeBSD_version < 1000029
 #  undef HAVE_STRCHRNUL /* FreeBSD added strchrnul() between 1000028 and 1000029 */
@@ -517,6 +525,7 @@ typedef unsigned smalluint;
 # undef HAVE_STRVERSCMP
 # undef HAVE_UNLOCKED_LINE_OPS
 # undef HAVE_NET_ETHERNET_H
+# undef HAVE_PRINTF_PERCENTM
 #endif
 
 /*