summaryrefslogtreecommitdiff
path: root/src/sys2.h
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-09-17 14:41:43 +0000
committerJim Meyering <jim@meyering.net>2002-09-17 14:41:43 +0000
commit32af38ad7ffdf2f075390041848fca4feb8cb254 (patch)
tree8bdd1f8faa820e2c1b6831c292eecff5c1d4d3c5 /src/sys2.h
parenteb025632fca732892b39d6bb66527c534f675dc6 (diff)
downloadcoreutils-32af38ad7ffdf2f075390041848fca4feb8cb254.tar.xz
(PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
From gettext's intl/loadmsgcat.c.
Diffstat (limited to 'src/sys2.h')
-rw-r--r--src/sys2.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sys2.h b/src/sys2.h
index 0ba910eb9..0c1cef6e0 100644
--- a/src/sys2.h
+++ b/src/sys2.h
@@ -264,6 +264,23 @@ char *alloca ();
# include <inttypes.h> /* for the definition of UINTMAX_MAX */
#endif
+#if !defined PRIdMAX || PRI_MACROS_BROKEN
+# undef PRIdMAX
+# define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld")
+#endif
+#if !defined PRIoMAX || PRI_MACROS_BROKEN
+# undef PRIoMAX
+# define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo")
+#endif
+#if !defined PRIuMAX || PRI_MACROS_BROKEN
+# undef PRIuMAX
+# define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu")
+#endif
+#if !defined PRIxMAX || PRI_MACROS_BROKEN
+# undef PRIxMAX
+# define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx")
+#endif
+
#include <ctype.h>
/* Jim Meyering writes: