Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in games-strategy/wormux/files: wormux-0.9.2-x86_64.patch
Date: Tue, 20 Apr 2010 16:57:16
Message-Id: 20100420165713.70CA12C049@corvid.gentoo.org
1 ssuominen 10/04/20 16:57:13
2
3 Added: wormux-0.9.2-x86_64.patch
4 Log:
5 Port upstream patch for x86_64 wrt #315921 by tman.
6 (Portage version: 2.2_rc67/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 games-strategy/wormux/files/wormux-0.9.2-x86_64.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-strategy/wormux/files/wormux-0.9.2-x86_64.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-strategy/wormux/files/wormux-0.9.2-x86_64.patch?rev=1.1&content-type=text/plain
13
14 Index: wormux-0.9.2-x86_64.patch
15 ===================================================================
16 http://bugs.gentoo.org/show_bug.cgi?id=315921
17
18 diff -ruN lib/fixedpoint.orig/fixed_class.h lib/fixedpoint/fixed_class.h
19 --- lib/fixedpoint.orig/fixed_class.h 2010-04-05 18:09:44.000000000 +0300
20 +++ lib/fixedpoint/fixed_class.h 2010-04-19 17:41:58.000000000 +0300
21 @@ -47,6 +47,12 @@
22
23 // The template argument p in all of the following functions refers to the
24 // fixed point precision (e.g. p = 8 gives 24.8 fixed point functions).
25 +#ifdef __APPLE__
26 + #define SIZE_T_FIXEDPOINT_METHODS
27 +#endif
28 +#if __WORDSIZE == 64
29 + #define SIZE_T_FIXEDPOINT_METHODS
30 +#endif
31
32 template <int p>
33 struct fixed_point {
34 @@ -57,9 +63,11 @@
35 /*explicit*/ fixed_point(int64_t i) : intValue(i << p) {}
36 /*explicit*/ fixed_point(float f) : intValue(float2fix<p>(f)) {}
37 /*explicit*/ fixed_point(double f) : intValue(float2fix<p>((float)f)) {}
38 +#if __WORDSIZE != 64
39 /*explicit*/ fixed_point(long int l) : intValue(((int64_t)l) << p) {}
40 +#endif
41 /*explicit*/ fixed_point(unsigned int l) : intValue(((int64_t)l) << p) {}
42 -#ifdef __APPLE__
43 +#ifdef SIZE_T_FIXEDPOINT_METHODS
44 /*explicit*/ fixed_point(size_t i) : intValue(((int64_t)i) << p) {}
45 #endif
46
47 @@ -141,7 +149,7 @@
48 inline fixed_point<p> operator / (unsigned int a, fixed_point<p> b)
49 { fixed_point<p> r(a); r /= b; return r; }
50
51 -#ifdef __APPLE__
52 +#ifdef SIZE_T_FIXEDPOINT_METHODS
53 template <int p>
54 inline fixed_point<p> operator + (size_t a, fixed_point<p> b)
55 { return b + a; }
56 diff -ruN lib/fixedpoint.orig/fixed_func.h lib/fixedpoint/fixed_func.h
57 --- lib/fixedpoint.orig/fixed_func.h 2010-04-05 18:09:44.000000000 +0300
58 +++ lib/fixedpoint/fixed_func.h 2010-04-19 17:41:58.000000000 +0300
59 @@ -46,7 +46,7 @@
60 #ifndef _MSC_VER
61 #include <stdint.h>
62 #else
63 -#include "stdint.h"
64 +#include "stdint_fallback.h"
65 #endif
66
67 namespace fixedpoint {
68 diff -ruN lib/fixedpoint.orig/Makefile.am lib/fixedpoint/Makefile.am
69 --- lib/fixedpoint.orig/Makefile.am 2010-04-05 18:09:44.000000000 +0300
70 +++ lib/fixedpoint/Makefile.am 2010-04-19 17:41:58.000000000 +0300
71 @@ -9,7 +9,7 @@
72 fixed_func.cpp \
73 fixed_func.h \
74 fixsintab.h \
75 - stdint.h
76 + stdint_fallback.h
77
78
79 AM_CXXFLAGS = -I$(top_srcdir)/lib/fixedpoint \
80 diff -ruN lib/fixedpoint.orig/stdint_fallback.h lib/fixedpoint/stdint_fallback.h
81 --- lib/fixedpoint.orig/stdint_fallback.h 1970-01-01 02:00:00.000000000 +0200
82 +++ lib/fixedpoint/stdint_fallback.h 2010-04-19 17:41:58.000000000 +0300
83 @@ -0,0 +1,184 @@
84 +/* ISO C9x 7.18 Integer types <stdint.h>
85 + * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
86 + *
87 + * THIS SOFTWARE IS NOT COPYRIGHTED
88 + *
89 + * Contributor: Danny Smith <danny_r_smith_2001@××××××××.nz>
90 + *
91 + * This source code is offered for use in the public domain. You may
92 + * use, modify or distribute it freely.
93 + *
94 + * This code is distributed in the hope that it will be useful but
95 + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
96 + * DISCLAIMED. This includes but is not limited to warranties of
97 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
98 + *
99 + * Date: 2000-12-02
100 + */
101 +
102 +
103 +#ifndef _STDINT_H
104 +#define _STDINT_H
105 +#define __need_wint_t
106 +#define __need_wchar_t
107 +#include <stddef.h>
108 +
109 +/* 7.18.1.1 Exact-width integer types */
110 +typedef signed char int8_t;
111 +typedef unsigned char uint8_t;
112 +typedef short int16_t;
113 +typedef unsigned short uint16_t;
114 +typedef int int32_t;
115 +typedef unsigned uint32_t;
116 +typedef long long int64_t;
117 +typedef unsigned long long uint64_t;
118 +
119 +/* 7.18.1.2 Minimum-width integer types */
120 +typedef signed char int_least8_t;
121 +typedef unsigned char uint_least8_t;
122 +typedef short int_least16_t;
123 +typedef unsigned short uint_least16_t;
124 +typedef int int_least32_t;
125 +typedef unsigned uint_least32_t;
126 +typedef long long int_least64_t;
127 +typedef unsigned long long uint_least64_t;
128 +
129 +/* 7.18.1.3 Fastest minimum-width integer types
130 + * Not actually guaranteed to be fastest for all purposes
131 + * Here we use the exact-width types for 8 and 16-bit ints.
132 + */
133 +typedef char int_fast8_t;
134 +typedef unsigned char uint_fast8_t;
135 +typedef short int_fast16_t;
136 +typedef unsigned short uint_fast16_t;
137 +typedef int int_fast32_t;
138 +typedef unsigned int uint_fast32_t;
139 +typedef long long int_fast64_t;
140 +typedef unsigned long long uint_fast64_t;
141 +
142 +/* 7.18.1.4 Integer types capable of holding object pointers */
143 +typedef int intptr_t;
144 +typedef unsigned uintptr_t;
145 +
146 +/* 7.18.1.5 Greatest-width integer types */
147 +typedef long long intmax_t;
148 +typedef unsigned long long uintmax_t;
149 +
150 +/* 7.18.2 Limits of specified-width integer types */
151 +#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
152 +
153 +/* 7.18.2.1 Limits of exact-width integer types */
154 +#define INT8_MIN (-128)
155 +#define INT16_MIN (-32768)
156 +#define INT32_MIN (-2147483647 - 1)
157 +#define INT64_MIN (-9223372036854775807LL - 1)
158 +
159 +#define INT8_MAX 127
160 +#define INT16_MAX 32767
161 +#define INT32_MAX 2147483647
162 +#define INT64_MAX 9223372036854775807LL
163 +
164 +#define UINT8_MAX 0xff /* 255U */
165 +#define UINT16_MAX 0xffff /* 65535U */
166 +#define UINT32_MAX 0xffffffff /* 4294967295U */
167 +#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
168 +
169 +/* 7.18.2.2 Limits of minimum-width integer types */
170 +#define INT_LEAST8_MIN INT8_MIN
171 +#define INT_LEAST16_MIN INT16_MIN
172 +#define INT_LEAST32_MIN INT32_MIN
173 +#define INT_LEAST64_MIN INT64_MIN
174 +
175 +#define INT_LEAST8_MAX INT8_MAX
176 +#define INT_LEAST16_MAX INT16_MAX
177 +#define INT_LEAST32_MAX INT32_MAX
178 +#define INT_LEAST64_MAX INT64_MAX
179 +
180 +#define UINT_LEAST8_MAX UINT8_MAX
181 +#define UINT_LEAST16_MAX UINT16_MAX
182 +#define UINT_LEAST32_MAX UINT32_MAX
183 +#define UINT_LEAST64_MAX UINT64_MAX
184 +
185 +/* 7.18.2.3 Limits of fastest minimum-width integer types */
186 +#define INT_FAST8_MIN INT8_MIN
187 +#define INT_FAST16_MIN INT16_MIN
188 +#define INT_FAST32_MIN INT32_MIN
189 +#define INT_FAST64_MIN INT64_MIN
190 +
191 +#define INT_FAST8_MAX INT8_MAX
192 +#define INT_FAST16_MAX INT16_MAX
193 +#define INT_FAST32_MAX INT32_MAX
194 +#define INT_FAST64_MAX INT64_MAX
195 +
196 +#define UINT_FAST8_MAX UINT8_MAX
197 +#define UINT_FAST16_MAX UINT16_MAX
198 +#define UINT_FAST32_MAX UINT32_MAX
199 +#define UINT_FAST64_MAX UINT64_MAX
200 +
201 +/* 7.18.2.4 Limits of integer types capable of holding
202 + object pointers */
203 +#define INTPTR_MIN INT32_MIN
204 +#define INTPTR_MAX INT32_MAX
205 +#define UINTPTR_MAX UINT32_MAX
206 +
207 +/* 7.18.2.5 Limits of greatest-width integer types */
208 +#define INTMAX_MIN INT64_MIN
209 +#define INTMAX_MAX INT64_MAX
210 +#define UINTMAX_MAX UINT64_MAX
211 +
212 +/* 7.18.3 Limits of other integer types */
213 +#define PTRDIFF_MIN INT32_MIN
214 +#define PTRDIFF_MAX INT32_MAX
215 +
216 +#define SIG_ATOMIC_MIN INT32_MIN
217 +#define SIG_ATOMIC_MAX INT32_MAX
218 +
219 +#define SIZE_MAX UINT32_MAX
220 +
221 +#ifndef WCHAR_MIN /* also in wchar.h */
222 +#define WCHAR_MIN 0
223 +#define WCHAR_MAX 0xffff /* UINT16_MAX */
224 +#endif
225 +
226 +/*
227 + * wint_t is unsigned short for compatibility with MS runtime
228 + */
229 +#define WINT_MIN 0
230 +#define WINT_MAX 0xffff /* UINT16_MAX */
231 +
232 +#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
233 +
234 +
235 +/* 7.18.4 Macros for integer constants */
236 +#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
237 +
238 +/* 7.18.4.1 Macros for minimum-width integer constants
239 +
240 + Accoding to Douglas Gwyn <gwyn@×××.mil>:
241 + "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
242 + 9899:1999 as initially published, the expansion was required
243 + to be an integer constant of precisely matching type, which
244 + is impossible to accomplish for the shorter types on most
245 + platforms, because C99 provides no standard way to designate
246 + an integer constant with width less than that of type int.
247 + TC1 changed this to require just an integer constant
248 + *expression* with *promoted* type."
249 +*/
250 +
251 +#define INT8_C(val) ((int8_t) + (val))
252 +#define UINT8_C(val) ((uint8_t) + (val##U))
253 +#define INT16_C(val) ((int16_t) + (val))
254 +#define UINT16_C(val) ((uint16_t) + (val##U))
255 +
256 +#define INT32_C(val) val##L
257 +#define UINT32_C(val) val##UL
258 +#define INT64_C(val) val##LL
259 +#define UINT64_C(val) val##ULL
260 +
261 +/* 7.18.4.2 Macros for greatest-width integer constants */
262 +#define INTMAX_C(val) INT64_C(val)
263 +#define UINTMAX_C(val) UINT64_C(val)
264 +
265 +#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
266 +
267 +#endif
268 diff -ruN lib/fixedpoint.orig/stdint.h lib/fixedpoint/stdint.h
269 --- lib/fixedpoint.orig/stdint.h 2010-04-05 18:09:44.000000000 +0300
270 +++ lib/fixedpoint/stdint.h 1970-01-01 02:00:00.000000000 +0200
271 @@ -1,186 +0,0 @@
272 -/* ISO C9x 7.18 Integer types <stdint.h>
273 - * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
274 - *
275 - * THIS SOFTWARE IS NOT COPYRIGHTED
276 - *
277 - * Contributor: Danny Smith <danny_r_smith_2001@××××××××.nz>
278 - *
279 - * This source code is offered for use in the public domain. You may
280 - * use, modify or distribute it freely.
281 - *
282 - * This code is distributed in the hope that it will be useful but
283 - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
284 - * DISCLAIMED. This includes but is not limited to warranties of
285 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
286 - *
287 - * Date: 2000-12-02
288 - */
289 -
290 -
291 -#ifndef _STDINT_H
292 -#define _STDINT_H
293 -#define __need_wint_t
294 -#define __need_wchar_t
295 -#include <stddef.h>
296 -
297 -/* 7.18.1.1 Exact-width integer types */
298 -typedef signed char int8_t;
299 -typedef unsigned char uint8_t;
300 -typedef short int16_t;
301 -typedef unsigned short uint16_t;
302 -typedef int int32_t;
303 -typedef unsigned uint32_t;
304 -typedef long long int64_t;
305 -typedef unsigned long long uint64_t;
306 -
307 -/* 7.18.1.2 Minimum-width integer types */
308 -typedef signed char int_least8_t;
309 -typedef unsigned char uint_least8_t;
310 -typedef short int_least16_t;
311 -typedef unsigned short uint_least16_t;
312 -typedef int int_least32_t;
313 -typedef unsigned uint_least32_t;
314 -typedef long long int_least64_t;
315 -typedef unsigned long long uint_least64_t;
316 -
317 -/* 7.18.1.3 Fastest minimum-width integer types
318 - * Not actually guaranteed to be fastest for all purposes
319 - * Here we use the exact-width types for 8 and 16-bit ints.
320 - */
321 -typedef char int_fast8_t;
322 -typedef unsigned char uint_fast8_t;
323 -typedef short int_fast16_t;
324 -typedef unsigned short uint_fast16_t;
325 -typedef int int_fast32_t;
326 -typedef unsigned int uint_fast32_t;
327 -typedef long long int_fast64_t;
328 -typedef unsigned long long uint_fast64_t;
329 -
330 -#ifndef __APPLE__
331 -/* 7.18.1.4 Integer types capable of holding object pointers */
332 -typedef int intptr_t;
333 -typedef unsigned uintptr_t;
334 -#endif
335 -
336 -/* 7.18.1.5 Greatest-width integer types */
337 -typedef long long intmax_t;
338 -typedef unsigned long long uintmax_t;
339 -
340 -/* 7.18.2 Limits of specified-width integer types */
341 -#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
342 -
343 -/* 7.18.2.1 Limits of exact-width integer types */
344 -#define INT8_MIN (-128)
345 -#define INT16_MIN (-32768)
346 -#define INT32_MIN (-2147483647 - 1)
347 -#define INT64_MIN (-9223372036854775807LL - 1)
348 -
349 -#define INT8_MAX 127
350 -#define INT16_MAX 32767
351 -#define INT32_MAX 2147483647
352 -#define INT64_MAX 9223372036854775807LL
353 -
354 -#define UINT8_MAX 0xff /* 255U */
355 -#define UINT16_MAX 0xffff /* 65535U */
356 -#define UINT32_MAX 0xffffffff /* 4294967295U */
357 -#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
358 -
359 -/* 7.18.2.2 Limits of minimum-width integer types */
360 -#define INT_LEAST8_MIN INT8_MIN
361 -#define INT_LEAST16_MIN INT16_MIN
362 -#define INT_LEAST32_MIN INT32_MIN
363 -#define INT_LEAST64_MIN INT64_MIN
364 -
365 -#define INT_LEAST8_MAX INT8_MAX
366 -#define INT_LEAST16_MAX INT16_MAX
367 -#define INT_LEAST32_MAX INT32_MAX
368 -#define INT_LEAST64_MAX INT64_MAX
369 -
370 -#define UINT_LEAST8_MAX UINT8_MAX
371 -#define UINT_LEAST16_MAX UINT16_MAX
372 -#define UINT_LEAST32_MAX UINT32_MAX
373 -#define UINT_LEAST64_MAX UINT64_MAX
374 -
375 -/* 7.18.2.3 Limits of fastest minimum-width integer types */
376 -#define INT_FAST8_MIN INT8_MIN
377 -#define INT_FAST16_MIN INT16_MIN
378 -#define INT_FAST32_MIN INT32_MIN
379 -#define INT_FAST64_MIN INT64_MIN
380 -
381 -#define INT_FAST8_MAX INT8_MAX
382 -#define INT_FAST16_MAX INT16_MAX
383 -#define INT_FAST32_MAX INT32_MAX
384 -#define INT_FAST64_MAX INT64_MAX
385 -
386 -#define UINT_FAST8_MAX UINT8_MAX
387 -#define UINT_FAST16_MAX UINT16_MAX
388 -#define UINT_FAST32_MAX UINT32_MAX
389 -#define UINT_FAST64_MAX UINT64_MAX
390 -
391 -/* 7.18.2.4 Limits of integer types capable of holding
392 - object pointers */
393 -#define INTPTR_MIN INT32_MIN
394 -#define INTPTR_MAX INT32_MAX
395 -#define UINTPTR_MAX UINT32_MAX
396 -
397 -/* 7.18.2.5 Limits of greatest-width integer types */
398 -#define INTMAX_MIN INT64_MIN
399 -#define INTMAX_MAX INT64_MAX
400 -#define UINTMAX_MAX UINT64_MAX
401 -
402 -/* 7.18.3 Limits of other integer types */
403 -#define PTRDIFF_MIN INT32_MIN
404 -#define PTRDIFF_MAX INT32_MAX
405 -
406 -#define SIG_ATOMIC_MIN INT32_MIN
407 -#define SIG_ATOMIC_MAX INT32_MAX
408 -
409 -#define SIZE_MAX UINT32_MAX
410 -
411 -#ifndef WCHAR_MIN /* also in wchar.h */
412 -#define WCHAR_MIN 0
413 -#define WCHAR_MAX 0xffff /* UINT16_MAX */
414 -#endif
415 -
416 -/*
417 - * wint_t is unsigned short for compatibility with MS runtime
418 - */
419 -#define WINT_MIN 0
420 -#define WINT_MAX 0xffff /* UINT16_MAX */
421 -
422 -#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
423 -
424 -
425 -/* 7.18.4 Macros for integer constants */
426 -#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
427 -
428 -/* 7.18.4.1 Macros for minimum-width integer constants
429 -
430 - Accoding to Douglas Gwyn <gwyn@×××.mil>:
431 - "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
432 - 9899:1999 as initially published, the expansion was required
433 - to be an integer constant of precisely matching type, which
434 - is impossible to accomplish for the shorter types on most
435 - platforms, because C99 provides no standard way to designate
436 - an integer constant with width less than that of type int.
437 - TC1 changed this to require just an integer constant
438 - *expression* with *promoted* type."
439 -*/
440 -
441 -#define INT8_C(val) ((int8_t) + (val))
442 -#define UINT8_C(val) ((uint8_t) + (val##U))
443 -#define INT16_C(val) ((int16_t) + (val))
444 -#define UINT16_C(val) ((uint16_t) + (val##U))
445 -
446 -#define INT32_C(val) val##L
447 -#define UINT32_C(val) val##UL
448 -#define INT64_C(val) val##LL
449 -#define UINT64_C(val) val##ULL
450 -
451 -/* 7.18.4.2 Macros for greatest-width integer constants */
452 -#define INTMAX_C(val) INT64_C(val)
453 -#define UINTMAX_C(val) UINT64_C(val)
454 -
455 -#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
456 -
457 -#endif