summaryrefslogtreecommitdiff
path: root/shells/bash/patches/patch-af
blob: 5d6b5736377fb34bec31af4965959444f2d10b49 (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.7 2015/03/07 22:40:48 rodent Exp $

--- builtins/printf.def.orig	2014-01-03 15:35:33.000000000 +0000
+++ builtins/printf.def
@@ -95,6 +95,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"
@@ -102,6 +107,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;
@@ -594,7 +606,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
@@ -621,7 +637,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