summaryrefslogtreecommitdiff
path: root/shells/bash/patches/patch-af
blob: e4a07a1b5e80464f02bfa30ed246e7ab4da02dbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
$NetBSD: patch-af,v 1.6 2011/03/12 15:26:45 wiz Exp $

--- builtins/printf.def.orig	2010-11-23 15:02:55.000000000 +0000
+++ builtins/printf.def
@@ -90,6 +90,11 @@ $END
 #  undef PRIdMAX
 #endif
 
+#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"
@@ -97,6 +102,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;
@@ -571,7 +583,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
@@ -598,7 +614,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