summaryrefslogtreecommitdiff
path: root/devel/libstash/patches/patch-ab
blob: 392166307d825875fe59ab4ddb89d0b3d03a2958 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
$NetBSD: patch-ab,v 1.1 2000/08/23 17:54:14 dmcmahill Exp $

needed to build on sparc which implements the va_arg macro differently than
other ports.

--- src/out.c.orig
+++ src/out.c
@@ -1054,4 +1054,13 @@
 	      const char * a_format, va_list a_p)
 {
+  cw_uint32_t cw32;
+  cw_uint64_t cw64;
+#ifdef _TYPE_FP96_DEFINED
+  cw_fp96_t cw96;
+#endif
+#ifdef _TYPE_FP128_DEFINED
+  cw_fp128_t cw128;
+#endif
+
   cw_sint32_t retval, size, format_len, i, j, enti;
   cw_uint32_t metric;
@@ -1125,10 +1134,12 @@
 	    case 4:
 	    {
-	      arg = (void *) &va_arg(a_p, cw_uint32_t);
+	      cw32 = va_arg(a_p, cw_uint32_t);
+	      arg = &cw32;
 	      break;
 	    }
 	    case 8:
 	    {
-	      arg = (void *) &va_arg(a_p, cw_uint64_t);
+	      cw64 = va_arg(a_p, cw_uint64_t);
+	      arg = &cw64;
 	      break;
 	    }
@@ -1136,5 +1147,6 @@
 	    case 12:
 	    {
-	      arg = (void *) &va_arg(a_p, cw_fp96_t);
+	      cw96 = va_arg(a_p, cw_fp96_t);
+	      arg = &cw96;
 	      break;
 	    }
@@ -1143,5 +1155,6 @@
 	    case 16:
 	    {
-	      arg = (void *) &va_arg(a_p, cw_fp128_t);
+	      cw128 = va_arg(a_p, cw_fp128_t);
+	      arg = &cw128;
 	      break;
 	    }
@@ -1232,4 +1245,12 @@
 	     va_list a_p)
 {
+  cw_uint32_t cw32;
+  cw_uint64_t cw64;
+#ifdef _TYPE_FP96_DEFINED
+  cw_fp96_t cw96;
+#endif
+#ifdef _TYPE_FP128_DEFINED
+  cw_fp128_t cw128;
+#endif
   cw_sint32_t retval, spec_metric;
   cw_uint32_t i, metric; /* Total number of bytes to be printed. */
@@ -1369,10 +1390,12 @@
 	      case 4:
 	      {
-		arg = (void *) &va_arg(a_p, cw_uint32_t);
+	        cw32 = va_arg(a_p, cw_uint32_t);
+		arg = &cw32;
 		break;
 	      }
 	      case 8:
 	      {
-		arg = (void *) &va_arg(a_p, cw_uint64_t);
+		cw64 = va_arg(a_p, cw_uint64_t);
+		arg =  &cw64;
 		break;
 	      }
@@ -1380,5 +1403,6 @@
 	      case 12:
 	      {
-		arg = (void *) &va_arg(a_p, cw_fp96_t);
+		cw96 = va_arg(a_p, cw_fp96_t);
+		arg = &cw96;
 		break;
 	      }
@@ -1387,5 +1411,6 @@
 	      case 16:
 	      {
-		arg = (void *) &va_arg(a_p, cw_fp128_t);
+		cw128 = va_arg(a_p, cw_fp128_t);
+		arg = &cw128;
 		break;
 	      }