View | Details | Raw Unified | Return to bug 196161 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-1 / +4 lines)
Lines 19-25 Link Here
19
		--without-libsquish
19
		--without-libsquish
20
INSTALL_TARGET=	install-strip
20
INSTALL_TARGET=	install-strip
21
USE_LDCONFIG=	yes
21
USE_LDCONFIG=	yes
22
USE_GCC=	any
23
22
24
WRKSRC=		${WRKDIR}/${DISTNAME:tl}
23
WRKSRC=		${WRKDIR}/${DISTNAME:tl}
25
24
Lines 97-102 Link Here
97
	@${REINPLACE_CMD} -e 's|<malloc\.h>|<stdlib.h>|g' \
96
	@${REINPLACE_CMD} -e 's|<malloc\.h>|<stdlib.h>|g' \
98
		${WRKSRC}/src-ILU/ilur/ilur.c
97
		${WRKSRC}/src-ILU/ilur/ilur.c
99
98
99
post-configure:
100
	${REINPLACE_CMD} -e 's,-std=gnu99,,' ${WRKSRC}/Makefile \
101
		${WRKSRC}/*/Makefile
102
100
post-install:
103
post-install:
101
	@${RMDIR} ${STAGEDIR}${DATADIR}/examples
104
	@${RMDIR} ${STAGEDIR}${DATADIR}/examples
102
	@${RMDIR} ${STAGEDIR}${DATADIR}
105
	@${RMDIR} ${STAGEDIR}${DATADIR}
(-)files/patch-clang (+363 lines)
Line 0 Link Here
1
--- src-IL/include/il_internal.h	2009-03-08 03:10:08.000000000 -0400
2
+++ src-IL/include/il_internal.h	2014-12-20 01:11:39.000000000 -0500
3
@@ -228,5 +228,5 @@
4
 ILboolean ilLoadBlpF(ILHANDLE File);
5
 ILboolean ilLoadBlpL(const void *Lump, ILuint Size);
6
-ILboolean ilIsValidBmp(ILconst_string CONST_RESTRICT FileName);
7
+ILboolean ilIsValidBmp(ILconst_string FileName);
8
 ILboolean ilIsValidBmpF(ILHANDLE File);
9
 ILboolean ilIsValidBmpL(const void *Lump, ILuint Size);
10
--- src-IL/src/il_exr.cpp	2009-03-08 03:10:09.000000000 -0400
11
+++ src-IL/src/il_exr.cpp	2014-12-20 01:15:55.000000000 -0500
12
@@ -11,5 +11,5 @@
13
 //-----------------------------------------------------------------------------
14
 
15
-
16
+#include <machine/endian.h>
17
 #include "il_internal.h"
18
 #ifndef IL_NO_EXR
19
@@ -246,5 +246,5 @@
20
 		in.readPixels (dataWindow.min.y, dataWindow.max.y);
21
     }
22
-    catch (const exception &e)
23
+    catch (const exception)
24
     {
25
 	// If some of the pixels in the file cannot be read,
26
@@ -252,5 +252,4 @@
27
 	// to the caller.
28
 		ilSetError(IL_LIB_EXR_ERROR);  // Could I use something a bit more descriptive based on e?
29
-		e;  // Prevent the compiler from yelling at us about this being unused.
30
 		return IL_FALSE;
31
     }
32
--- src-IL/include/il_endian.h	2009-03-08 03:10:08.000000000 -0400
33
+++ src-IL/include/il_endian.h	2014-12-20 01:28:47.000000000 -0500
34
@@ -15,14 +15,7 @@
35
 
36
 #include "il_internal.h"
37
+#include <machine/endian.h>
38
 
39
-#ifdef WORDS_BIGENDIAN  // This is defined by ./configure.
40
-	#ifndef __BIG_ENDIAN__
41
-	#define __BIG_ENDIAN__ 1
42
-	#endif
43
-#endif
44
-
45
-#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __BIG_ENDIAN__) \
46
-  || (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__))
47
- 	#undef __LITTLE_ENDIAN__
48
+#if BYTE_ORDER == BIG_ENDIAN
49
 	#define Short(s) iSwapShort(s)
50
 	#define UShort(s) iSwapUShort(s)
51
@@ -39,7 +32,4 @@
52
 	#define BigDouble(d)  
53
 #else
54
-	#undef __BIG_ENDIAN__
55
-	#undef __LITTLE_ENDIAN__  // Not sure if it's defined by any compiler...
56
-	#define __LITTLE_ENDIAN__
57
 	#define Short(s)  
58
 	#define UShort(s)  
59
@@ -168,5 +158,5 @@
60
 	ILushort s;
61
 	iread(&s, sizeof(ILushort), 1);
62
-#ifdef __BIG_ENDIAN__
63
+#if BYTE_ORDER == BIG_ENDIAN
64
 	iSwapUShort(&s);
65
 #endif
66
@@ -177,5 +167,5 @@
67
 	ILshort s;
68
 	iread(&s, sizeof(ILshort), 1);
69
-#ifdef __BIG_ENDIAN__
70
+#if BYTE_ORDER == BIG_ENDIAN
71
 	iSwapShort(&s);
72
 #endif
73
@@ -186,5 +176,5 @@
74
 	ILuint i;
75
 	iread(&i, sizeof(ILuint), 1);
76
-#ifdef __BIG_ENDIAN__
77
+#if BYTE_ORDER == BIG_ENDIAN
78
 	iSwapUInt(&i);
79
 #endif
80
@@ -195,5 +185,5 @@
81
 	ILint i;
82
 	iread(&i, sizeof(ILint), 1);
83
-#ifdef __BIG_ENDIAN__
84
+#if BYTE_ORDER == BIG_ENDIAN
85
 	iSwapInt(&i);
86
 #endif
87
@@ -204,5 +194,5 @@
88
 	ILfloat f;
89
 	iread(&f, sizeof(ILfloat), 1);
90
-#ifdef __BIG_ENDIAN__
91
+#if BYTE_ORDER == BIG_ENDIAN
92
 	iSwapFloat(&f);
93
 #endif
94
@@ -213,5 +203,5 @@
95
 	ILdouble d;
96
 	iread(&d, sizeof(ILdouble), 1);
97
-#ifdef __BIG_ENDIAN__
98
+#if BYTE_ORDER == BIG_ENDIAN
99
 	iSwapDouble(&d);
100
 #endif
101
@@ -223,5 +213,5 @@
102
 	ILushort s;
103
 	iread(&s, sizeof(ILushort), 1);
104
-#ifdef __LITTLE_ENDIAN__
105
+#if BYTE_ORDER == LITTLE_ENDIAN
106
 	iSwapUShort(&s);
107
 #endif
108
@@ -233,5 +223,5 @@
109
 	ILshort s;
110
 	iread(&s, sizeof(ILshort), 1);
111
-#ifdef __LITTLE_ENDIAN__
112
+#if BYTE_ORDER == LITTLE_ENDIAN
113
 	iSwapShort(&s);
114
 #endif
115
@@ -243,5 +233,5 @@
116
 	ILuint i;
117
 	iread(&i, sizeof(ILuint), 1);
118
-#ifdef __LITTLE_ENDIAN__
119
+#if BYTE_ORDER == LITTLE_ENDIAN
120
 	iSwapUInt(&i);
121
 #endif
122
@@ -253,5 +243,5 @@
123
 	ILint i;
124
 	iread(&i, sizeof(ILint), 1);
125
-#ifdef __LITTLE_ENDIAN__
126
+#if BYTE_ORDER == LITTLE_ENDIAN
127
 	iSwapInt(&i);
128
 #endif
129
@@ -263,5 +253,5 @@
130
 	ILfloat f;
131
 	iread(&f, sizeof(ILfloat), 1);
132
-#ifdef __LITTLE_ENDIAN__
133
+#if BYTE_ORDER == LITTLE_ENDIAN
134
 	iSwapFloat(&f);
135
 #endif
136
@@ -273,5 +263,5 @@
137
 	ILdouble d;
138
 	iread(&d, sizeof(ILdouble), 1);
139
-#ifdef __LITTLE_ENDIAN__
140
+#if BYTE_ORDER == LITTLE_ENDIAN
141
 	iSwapDouble(&d);
142
 #endif
143
@@ -280,5 +270,5 @@
144
 
145
 INLINE ILubyte SaveLittleUShort(ILushort s) {
146
-#ifdef __BIG_ENDIAN__
147
+#if BYTE_ORDER == BIG_ENDIAN
148
 	iSwapUShort(&s);
149
 #endif
150
@@ -287,5 +277,5 @@
151
 
152
 INLINE ILubyte SaveLittleShort(ILshort s) {
153
-#ifdef __BIG_ENDIAN__
154
+#if BYTE_ORDER == BIG_ENDIAN
155
 	iSwapShort(&s);
156
 #endif
157
@@ -295,5 +285,5 @@
158
 
159
 INLINE ILubyte SaveLittleUInt(ILuint i) {
160
-#ifdef __BIG_ENDIAN__
161
+#if BYTE_ORDER == BIG_ENDIAN
162
 	iSwapUInt(&i);
163
 #endif
164
@@ -303,5 +293,5 @@
165
 
166
 INLINE ILubyte SaveLittleInt(ILint i) {
167
-#ifdef __BIG_ENDIAN__
168
+#if BYTE_ORDER == BIG_ENDIAN
169
 	iSwapInt(&i);
170
 #endif
171
@@ -310,5 +300,5 @@
172
 
173
 INLINE ILubyte SaveLittleFloat(ILfloat f) {
174
-#ifdef __BIG_ENDIAN__
175
+#if BYTE_ORDER == BIG_ENDIAN
176
 	iSwapFloat(&f);
177
 #endif
178
@@ -318,5 +308,5 @@
179
 
180
 INLINE ILubyte SaveLittleDouble(ILdouble d) {
181
-#ifdef __BIG_ENDIAN__
182
+#if BYTE_ORDER == BIG_ENDIAN
183
 	iSwapDouble(&d);
184
 #endif
185
@@ -326,5 +316,5 @@
186
 
187
 INLINE ILubyte SaveBigUShort(ILushort s) {
188
-#ifdef __LITTLE_ENDIAN__
189
+#if BYTE_ORDER == LITTLE_ENDIAN
190
 	iSwapUShort(&s);
191
 #endif
192
@@ -334,5 +324,5 @@
193
 
194
 INLINE ILubyte SaveBigShort(ILshort s) {
195
-#ifdef __LITTLE_ENDIAN__
196
+#if BYTE_ORDER == LITTLE_ENDIAN
197
 	iSwapShort(&s);
198
 #endif
199
@@ -342,5 +332,5 @@
200
 
201
 INLINE ILubyte SaveBigUInt(ILuint i) {
202
-#ifdef __LITTLE_ENDIAN__
203
+#if BYTE_ORDER == LITTLE_ENDIAN
204
 	iSwapUInt(&i);
205
 #endif
206
@@ -350,5 +340,5 @@
207
 
208
 INLINE ILubyte SaveBigInt(ILint i) {
209
-#ifdef __LITTLE_ENDIAN__
210
+#if BYTE_ORDER == LITTLE_ENDIAN
211
 	iSwapInt(&i);
212
 #endif
213
@@ -358,5 +348,5 @@
214
 
215
 INLINE ILubyte SaveBigFloat(ILfloat f) {
216
-#ifdef __LITTLE_ENDIAN__
217
+#if BYTE_ORDER == LITTLE_ENDIAN
218
 	iSwapFloat(&f);
219
 #endif
220
@@ -366,5 +356,5 @@
221
 
222
 INLINE ILubyte SaveBigDouble(ILdouble d) {
223
-#ifdef __LITTLE_ENDIAN__
224
+#if BYTE_ORDER == LITTLE_ENDIAN
225
 	iSwapDouble(&d);
226
 #endif
227
--- ./src-IL/src/il_convert.c	2009-03-08 03:10:09.000000000 -0400
228
+++ ./src-IL/src/il_convert.c	2014-12-20 01:36:37.000000000 -0500
229
@@ -1018,5 +1018,5 @@
230
 	}
231
 /*	Swap Colors on Big Endian !!!!!
232
-#ifdef __BIG_ENDIAN__
233
+#if BYTE_ORDER == BIG_ENDIAN
234
 	// Swap endian
235
 	EndianSwapData(iCurImage);
236
--- ./src-IL/src/il_dicom.c	2009-03-08 03:10:09.000000000 -0400
237
+++ ./src-IL/src/il_dicom.c	2014-12-20 01:36:37.000000000 -0500
238
@@ -536,5 +536,5 @@
239
 
240
 	// We may have to swap the order of the data.
241
-#ifdef __BIG_ENDIAN__
242
+#if BYTE_ORDER == BIG_ENDIAN
243
 			if (!Header.BigEndian) {
244
 				if (Header.Format == IL_RGB)
245
--- ./src-IL/src/il_icon.c	2014-12-20 01:00:18.000000000 -0500
246
+++ ./src-IL/src/il_icon.c	2014-12-20 01:36:37.000000000 -0500
247
@@ -555,5 +555,5 @@
248
 
249
 	//fix endianess
250
-#ifdef __LITTLE_ENDIAN__
251
+#if BYTE_ORDER == LITTLE_ENDIAN
252
 	if (bit_depth == 16)
253
 		png_set_swap(ico_png_ptr);
254
--- ./src-IL/src/il_png.c	2014-12-20 01:00:18.000000000 -0500
255
+++ ./src-IL/src/il_png.c	2014-12-20 01:36:37.000000000 -0500
256
@@ -308,5 +308,5 @@
257
 
258
 	//fix endianess
259
-#ifdef __LITTLE_ENDIAN__
260
+#if BYTE_ORDER == LITTLE_ENDIAN
261
 	if (bit_depth == 16)
262
 		png_set_swap(png_ptr);
263
--- ./src-IL/src/il_psd.c	2009-03-08 03:10:09.000000000 -0400
264
+++ ./src-IL/src/il_psd.c	2014-12-20 01:36:37.000000000 -0500
265
@@ -542,5 +542,5 @@
266
 		return NULL;
267
 	}
268
-#ifdef __LITTLE_ENDIAN__
269
+#if BYTE_ORDER == LITTLE_ENDIAN
270
 	for (i = 0; i < Head->Height * ChannelNum; i++) {
271
 		iSwapUShort(&RleTable[i]);
272
--- ./src-IL/src/il_tiff.c	2009-03-08 03:10:09.000000000 -0400
273
+++ ./src-IL/src/il_tiff.c	2014-12-20 01:36:37.000000000 -0500
274
@@ -611,5 +611,5 @@
275
 			Image->Origin = IL_ORIGIN_LOWER_LEFT;  // eiu...dunno if this is right
276
 
277
-#ifdef __BIG_ENDIAN__ //TIFFReadRGBAImage reads abgr on big endian, convert to rgba
278
+#if BYTE_ORDER == BIG_ENDIAN //TIFFReadRGBAImage reads abgr on big endian, convert to rgba
279
 			EndianSwapData(Image);
280
 #endif
281
@@ -636,5 +636,5 @@
282
 				case 3:
283
 					//TODO: why the ifdef??
284
-#ifdef __LITTLE_ENDIAN__
285
+#if BYTE_ORDER == LITTLE_ENDIAN
286
 					ilConvertImage(IL_RGB, IL_UNSIGNED_BYTE);
287
 #endif			
288
@@ -647,5 +647,5 @@
289
 					/*			
290
 					//invert alpha
291
-#ifdef __LITTLE_ENDIAN__
292
+#if BYTE_ORDER == LITTLE_ENDIAN
293
 					pImageData += 3;
294
 #endif			
295
--- ./src-ILUT/src/ilut_sdlsurface.c	2009-03-08 03:10:11.000000000 -0400
296
+++ ./src-ILUT/src/ilut_sdlsurface.c	2014-12-20 01:36:37.000000000 -0500
297
@@ -28,5 +28,5 @@
298
 {
299
 //#if SDL_BYTEORDER == SDL_BIG_ENDIAN
300
-#ifdef __BIG_ENDIAN__
301
+#if BYTE_ORDER == BIG_ENDIAN
302
 	isBigEndian = 1;
303
     rmask = 0xFF000000;
304
@@ -81,5 +81,5 @@
305
 	}
306
 	else if (Image->Format != IL_COLOR_INDEX) {  // We have to convert the image.
307
-		#ifdef __BIG_ENDIAN__
308
+		#if BYTE_ORDER == BIG_ENDIAN
309
 		Image = iConvertImage(Image, IL_RGBA, IL_UNSIGNED_BYTE);
310
 		#else
311
--- src-IL/src/il_ilbm.c	2009-03-08 04:30:11.000000000 -0400
312
+++ src-IL/src/il_ilbm.c	2014-12-20 01:38:51.000000000 -0500
313
@@ -620,5 +620,5 @@
314
                             finalcolor = pixelcolor;
315
                         }
316
-#if defined( __LITTLE_ENDIAN__ )
317
+#if BYTE_ORDER == LITTLE_ENDIAN
318
                         {
319
                             *ptr++ = (Uint8)(finalcolor>>16);
320
--- src-IL/src/il_sgi.c	2009-03-08 03:10:09.000000000 -0400
321
+++ src-IL/src/il_sgi.c	2014-12-20 01:40:37.000000000 -0500
322
@@ -213,5 +213,5 @@
323
 ILboolean iReadRleSgi(iSgiHeader *Head)
324
 {
325
-	#ifdef __LITTLE_ENDIAN__
326
+	#if BYTE_ORDER == LITTLE_ENDIAN
327
 	ILuint ixTable;
328
 	#endif
329
@@ -234,5 +234,5 @@
330
 		goto cleanup_error;
331
 
332
-#ifdef __LITTLE_ENDIAN__
333
+#if BYTE_ORDER == LITTLE_ENDIAN
334
 	// Fix the offset/len table (it's big endian format)
335
 	for (ixTable = 0; ixTable < TableSize; ixTable++) {
336
@@ -290,5 +290,5 @@
337
 	}
338
 
339
-	#ifdef __LITTLE_ENDIAN__
340
+	#if BYTE_ORDER == LITTLE_ENDIAN
341
 	if (Head->Bpc == 2)
342
 		sgiSwitchData(iCurImage->Data, iCurImage->SizeOfData);
343
@@ -331,5 +331,5 @@
344
 			return -1;
345
 		
346
-#ifndef __LITTLE_ENDIAN__
347
+#if BYTE_ORDER != LITTLE_ENDIAN
348
 		iSwapUShort(&Pixel);
349
 #endif
350
@@ -347,5 +347,5 @@
351
 			if (iread(&Pixel, Head->Bpc, 1) != 1)
352
 				return -1;
353
-#ifndef __LITTLE_ENDIAN__
354
+#if BYTE_ORDER != LITTLE_ENDIAN
355
 			iSwapUShort(&Pixel);
356
 #endif
357
@@ -742,5 +742,5 @@
358
 		StartTable[y] = DataOff;
359
 		DataOff += LenTable[y];
360
-#ifdef __LITTLE_ENDIAN__
361
+#if BYTE_ORDER == LITTLE_ENDIAN
362
 		iSwapUInt(&StartTable[y]);
363
  		iSwapUInt(&LenTable[y]);

Return to bug 196161