[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problems with PRIdMAX processing
From: |
Michael Wardle |
Subject: |
Re: problems with PRIdMAX processing |
Date: |
Mon, 03 Nov 2003 12:45:54 +1000 |
(Continued...)
/usr/include/inttypes.h on this AIX host has:
------------------------------------------------------------
#define PRIdMAX %lld
#define PRIoMAX %llo
#define PRIxMAX %llx
#define PRIuMAX %llu
#define PRIdMAX %ld
#define PRIoMAX %lo
#define PRIxMAX %lx
#define PRIuMAX %lu
------------------------------------------------------------
While bash expects something of the form
------------------------------------------------------------
#define PRIdMAX "lld"
... ...
------------------------------------------------------------
The following undefines PRI[du]MAX on AIX so the bash #defines are
picked up, and makes the other changes mentioned in my first mail
in this thread.
------------------------------------------------------------
diff -ur bash-2.05b/builtins/printf.def
bash-2.05b.lld2/builtins/printf.def
--- bash-2.05b/builtins/printf.def Tue May 14 04:36:04 2002
+++ bash-2.05b.lld2/builtins/printf.def Mon Nov 3 12:29:32 2003
@@ -61,6 +61,11 @@
#include "bashgetopt.h"
#include "common.h"
+#if defined (_AIX)
+ /* AIX defines do not work. Undefine them. */
+# undef PRIdMAX
+# undef PRIuMAX
+#endif
#if !defined (PRIdMAX)
# if HAVE_LONG_LONG
# define PRIdMAX "lld"
@@ -68,6 +73,13 @@
# define PRIdMAX "ld"
# endif
#endif
+#if !defined (PRIuMAX)
+# if HAVE_LONG_LONG
+# define PRIuMAX "llu"
+# else
+# define PRIuMAX "lu"
+# endif
+#endif
#if !defined (errno)
extern int errno;
@@ -344,7 +356,7 @@
p = pp = getintmax ();
if (p != pp)
{
- f = mklong (start, PRIdMAX, sizeof (PRIdMAX) - 2);
+ f = mklong (start, PRIdMAX, sizeof (intmax_t) - 2);
PF (f, pp);
}
else
@@ -371,7 +383,7 @@
p = pp = getuintmax ();
if (p != pp)
{
- f = mklong (start, PRIdMAX, sizeof (PRIdMAX) - 2);
+ f = mklong (start, PRIuMAX, sizeof (uintmax_t) - 2);
PF (f, pp);
}
else
------------------------------------------------------------
--
Michael Wardle
http://www.endbracket.net/michael/
michael@endbracket.net
+61-415-439-838