$NetBSD: patch-af,v 1.3 2006/10/22 11:18:10 wiz Exp $ --- builtins/printf.def.orig 2006-09-18 12:48:42.000000000 +0000 +++ builtins/printf.def @@ -64,6 +64,11 @@ $END #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" @@ -71,6 +76,13 @@ $END # 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; @@ -452,7 +464,11 @@ printf_builtin (list) 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 @@ -479,7 +495,11 @@ printf_builtin (list) 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