[MLton-commit] r4295
Matthew Fluet
MLton@mlton.org
Fri, 6 Jan 2006 13:08:59 -0800
Formatting
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h 2006-01-06 21:06:44 UTC (rev 4294)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h 2006-01-06 21:08:58 UTC (rev 4295)
@@ -74,8 +74,14 @@
static inline void writeUintmaxX (int fd, uintmax_t u) {
static char buf[BUF_SIZE];
-
- sprintf (buf, "0x%08"PRIxMAX, u);
+
+ if (sizeof(uintmax_t) == 4) {
+ sprintf (buf, "0x%08"PRIxMAX, u);
+ } else if (sizeof(uintmax_t) == 8) {
+ sprintf (buf, "0x%016"PRIxMAX, u);
+ } else {
+ sprintf (buf, "0x"PRIxMAX, u);
+ }
writeString (fd, buf);
}