summaryrefslogtreecommitdiff
path: root/uts/debian/patches/add-MIN-MAX.patch
blob: 06e02336f0834a1fbabb9459f2fc63d66b0f9de2 (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
Index: uts/usr/src/uts/common/sys/param.h
===================================================================
--- uts.orig/usr/src/uts/common/sys/param.h	2014-03-01 16:18:38.000000000 +0400
+++ uts/usr/src/uts/common/sys/param.h	2014-03-01 23:10:14.997888590 +0400
@@ -195,6 +195,13 @@
 #define	MAXSYMLINKS	20
 #define	MAXNAMELEN	256
 
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+
 /*
  * MAXLINKNAMELEN defines the longest possible permitted datalink name,
  * including the terminating NUL.  Note that this must not be larger
Index: uts/usr/src/uts/common/sys/fs/hsfs_rrip.h
===================================================================
--- uts.orig/usr/src/uts/common/sys/fs/hsfs_rrip.h	2014-03-01 16:18:37.000000000 +0400
+++ uts/usr/src/uts/common/sys/fs/hsfs_rrip.h	2014-03-01 23:10:15.004395216 +0400
@@ -62,8 +62,9 @@
  */
 #define	MS_NO_RRIP		0x800000  /* if set, don't use Rock Ridge */
 
-
+#ifndef MIN
 #define	MIN(a, b)   ((a) < (b) ? (a) : (b))
+#endif
 
 /*
  * Make sure we have this first
Index: uts/usr/src/uts/intel/io/mc-amd/mcamd_drv.c
===================================================================
--- uts.orig/usr/src/uts/intel/io/mc-amd/mcamd_drv.c	2014-03-01 16:18:39.000000000 +0400
+++ uts/usr/src/uts/intel/io/mc-amd/mcamd_drv.c	2014-03-01 23:10:15.008714353 +0400
@@ -77,8 +77,12 @@
 krwlock_t mc_lock;
 int mc_hold_attached = 1;
 
+#ifndef MAX
 #define	MAX(m, n) ((m) >= (n) ? (m) : (n))
+#endif
+#ifndef MIN
 #define	MIN(m, n) ((m) <= (n) ? (m) : (n))
+#endif
 
 /*
  * The following tuneable is used to determine the DRAM scrubbing rate.
Index: uts/usr/src/uts/common/io/ral/ral_rate.c
===================================================================
--- uts.orig/usr/src/uts/common/io/ral/ral_rate.c	2014-03-01 16:18:32.000000000 +0400
+++ uts/usr/src/uts/common/io/ral/ral_rate.c	2014-03-01 23:10:15.011581762 +0400
@@ -53,7 +53,9 @@
 
 #include "ral_rate.h"
 
+#ifndef MAX
 #define	MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
 
 #ifdef interpolate
 #undef interpolate
Index: uts/usr/src/uts/common/io/ib/adapters/hermon/hermon_stats.c
===================================================================
--- uts.orig/usr/src/uts/common/io/ib/adapters/hermon/hermon_stats.c	2014-03-01 16:18:31.000000000 +0400
+++ uts/usr/src/uts/common/io/ib/adapters/hermon/hermon_stats.c	2014-03-01 23:10:15.013397890 +0400
@@ -78,10 +78,9 @@
 	{"clear_pic", 0, 0}
 };
 
-/*
- * Return the maximum of (x) and (y)
- */
+#ifndef MAX
 #define	MAX(x, y)	(((x) > (y)) ? (x) : (y))
+#endif
 
 /*
  * Set (x) to the maximum of (x) and (y)
Index: uts/usr/src/uts/common/io/ib/adapters/tavor/tavor_stats.c
===================================================================
--- uts.orig/usr/src/uts/common/io/ib/adapters/tavor/tavor_stats.c	2014-03-01 16:18:31.000000000 +0400
+++ uts/usr/src/uts/common/io/ib/adapters/tavor/tavor_stats.c	2014-03-01 23:10:15.015041350 +0400
@@ -94,10 +94,9 @@
 	{"clear_pic", 0, 0, 0, 0}
 };
 
-/*
- * Return the maximum of (x) and (y)
- */
+#ifndef MAX
 #define	MAX(x, y)	(((x) > (y)) ? (x) : (y))
+#endif
 
 /*
  * Set (x) to the maximum of (x) and (y)
Index: uts/usr/src/uts/common/io/ppp/spppcomp/zlib.c
===================================================================
--- uts.orig/usr/src/uts/common/io/ppp/spppcomp/zlib.c	2014-03-01 16:18:32.000000000 +0400
+++ uts/usr/src/uts/common/io/ppp/spppcomp/zlib.c	2014-03-01 23:10:15.023367717 +0400
@@ -2444,9 +2444,9 @@
 }
 #endif /* DEBUG_ZLIB */
 
-
+#ifndef MAX
 #define	MAX(a, b) (a >= b ? a : b)
-/* the arguments must not have side effects */
+#endif
 
 /*
  * ===========================================================================
Index: uts/usr/src/uts/intel/io/pci/pci_memlist.c
===================================================================
--- uts.orig/usr/src/uts/intel/io/pci/pci_memlist.c	2014-03-01 16:18:39.000000000 +0400
+++ uts/usr/src/uts/intel/io/pci/pci_memlist.c	2014-03-01 23:10:15.025795978 +0400
@@ -144,8 +144,12 @@
  * Delete memlist entries, assuming list sorted by address
  */
 
+#ifndef MIN
 #define	MIN(a, b)	((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
 #define	MAX(a, b)	((a) > (b) ? (a) : (b))
+#endif
 #define	IN_RANGE(a, b, e) ((a) >= (b) && (a) <= (e))
 
 int
Index: uts/usr/src/uts/common/fs/sockfs/sockcommon_subr.c
===================================================================
--- uts.orig/usr/src/uts/common/fs/sockfs/sockcommon_subr.c	2014-03-01 16:18:28.000000000 +0400
+++ uts/usr/src/uts/common/fs/sockfs/sockcommon_subr.c	2014-03-01 23:10:15.029136454 +0400
@@ -424,7 +424,9 @@
 	}
 }
 
+#ifndef MIN
 #define	MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
 /* Copy userdata into a new mblk_t */
 mblk_t *
 socopyinuio(uio_t *uiop, ssize_t iosize, size_t wroff, ssize_t maxblk,
Index: uts/usr/src/uts/common/io/ib/ibnex/ibnex_ioctl.c
===================================================================
--- uts.orig/usr/src/uts/common/io/ib/ibnex/ibnex_ioctl.c	2014-03-01 16:18:31.000000000 +0400
+++ uts/usr/src/uts/common/io/ib/ibnex/ibnex_ioctl.c	2014-03-01 23:10:15.033471456 +0400
@@ -40,8 +40,9 @@
 #include <sys/mdi_impldefs.h>
 #include <sys/sunmdi.h>
 
-/* return the minimum value of (x) and (y) */
+#ifndef MIN
 #define	MIN(x, y)	((x) < (y) ? (x) : (y))
+#endif
 
 /*
  * function prototypes