$NetBSD: patch-af,v 1.1 2005/03/15 02:05:49 garbled Exp $ --- builtins/printf.def.orig 2003-12-19 16:04:06.000000000 -0700 +++ builtins/printf.def 2005-03-14 18:56:57.000000000 -0700 @@ -62,6 +62,11 @@ #include "bashgetopt.h" #include "common.h" +#if defined (_AIX) && !defined (_AIX51) + /* AIX defines do not work. Undefine them. */ +# undef PRIdMAX +# undef PRIuMAX +#endif #if !defined (PRIdMAX) # if HAVE_LONG_LONG # define PRIdMAX "lld" @@ -69,6 +74,13 @@ # define PRIdMAX "ld" # endif #endif +#if !defined (PRIuMAX) && defined (_AIX) +# if HAVE_LONG_LONG +# define PRIuMAX "llu" +# else +# define PRIuMAX "lu" +# endif +#endif #if !defined (errno) extern int errno; @@ -344,7 +356,11 @@ p = pp = getintmax (); if (p != pp) { +#if defined (_AIX) && !defined (_AIX51) + f = mklong (start, PRIdMAX, sizeof (intmax_t) - 2); +#else f = mklong (start, PRIdMAX, sizeof (PRIdMAX) - 2); +#endif PF (f, pp); } else @@ -371,7 +387,11 @@ p = pp = getuintmax (); if (p != pp) { +#if defined (_AIX) && !defined (_AIX51) + f = mklong (start, PRIuMAX, sizeof (uintmax_t) - 2); +#else f = mklong (start, PRIdMAX, sizeof (PRIdMAX) - 2); +#endif PF (f, pp); } else