1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/uClibc/20080801/200-mips-typeof.patch Thu Apr 02 21:21:15 2009 +0000
1.3 @@ -0,0 +1,112 @@
1.4 +Index: uClibc/libc/sysdeps/linux/mips/bits/atomic.h
1.5 +===================================================================
1.6 +--- uClibc/libc/sysdeps/linux/mips/bits/atomic.h (revision 23002)
1.7 ++++ uClibc/libc/sysdeps/linux/mips/bits/atomic.h (working copy)
1.8 +@@ -110,22 +110,22 @@
1.9 + /* For all "bool" routines, we return FALSE if exchange succesful. */
1.10 +
1.11 + #define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \
1.12 +-({ typeof (*mem) __prev; int __cmp; \
1.13 ++({ __typeof (*mem) __prev; int __cmp; \
1.14 + __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \
1.15 + !__cmp; })
1.16 +
1.17 + #define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \
1.18 +-({ typeof (*mem) __prev; int __cmp; \
1.19 ++({ __typeof (*mem) __prev; int __cmp; \
1.20 + __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \
1.21 + !__cmp; })
1.22 +
1.23 + #define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \
1.24 +-({ typeof (*mem) __prev; int __cmp; \
1.25 ++({ __typeof (*mem) __prev; int __cmp; \
1.26 + __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \
1.27 + !__cmp; })
1.28 +
1.29 + #define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \
1.30 +-({ typeof (*mem) __prev; int __cmp; \
1.31 ++({ __typeof (*mem) __prev; int __cmp; \
1.32 + __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \
1.33 + !__cmp; })
1.34 +
1.35 +@@ -133,24 +133,24 @@
1.36 + successful or not. */
1.37 +
1.38 + #define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq) \
1.39 +-({ typeof (*mem) __prev; int __cmp; \
1.40 ++({ __typeof (*mem) __prev; int __cmp; \
1.41 + __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \
1.42 +- (typeof (*mem))__prev; })
1.43 ++ (__typeof (*mem))__prev; })
1.44 +
1.45 + #define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \
1.46 +-({ typeof (*mem) __prev; int __cmp; \
1.47 ++({ __typeof (*mem) __prev; int __cmp; \
1.48 + __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \
1.49 +- (typeof (*mem))__prev; })
1.50 ++ (__typeof (*mem))__prev; })
1.51 +
1.52 + #define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \
1.53 +-({ typeof (*mem) __prev; int __cmp; \
1.54 ++({ __typeof (*mem) __prev; int __cmp; \
1.55 + __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \
1.56 +- (typeof (*mem))__prev; })
1.57 ++ (__typeof (*mem))__prev; })
1.58 +
1.59 + #define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \
1.60 +-({ typeof (*mem) __prev; int __cmp; \
1.61 ++({ __typeof (*mem) __prev; int __cmp; \
1.62 + __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \
1.63 +- (typeof (*mem))__prev; })
1.64 ++ (__typeof (*mem))__prev; })
1.65 +
1.66 + /* Compare and exchange with "acquire" semantics, ie barrier after. */
1.67 +
1.68 +@@ -183,7 +183,7 @@
1.69 + (abort (), 0)
1.70 +
1.71 + #define __arch_exchange_xxx_32_int(mem, newval, rel, acq) \
1.72 +-({ typeof (*mem) __prev; int __cmp; \
1.73 ++({ __typeof (*mem) __prev; int __cmp; \
1.74 + __asm__ __volatile__ ("\n" \
1.75 + ".set push\n\t" \
1.76 + MIPS_PUSH_MIPS2 \
1.77 +@@ -207,7 +207,7 @@
1.78 + (abort (), 0)
1.79 + #else
1.80 + #define __arch_exchange_xxx_64_int(mem, newval, rel, acq) \
1.81 +-({ typeof (*mem) __prev; int __cmp; \
1.82 ++({ __typeof (*mem) __prev; int __cmp; \
1.83 + __asm__ __volatile__ ("\n" \
1.84 + ".set push\n\t" \
1.85 + MIPS_PUSH_MIPS2 \
1.86 +@@ -236,13 +236,13 @@
1.87 + /* Atomically add value and return the previous (unincremented) value. */
1.88 +
1.89 + #define __arch_exchange_and_add_8_int(mem, newval, rel, acq) \
1.90 +- (abort (), (typeof(*mem)) 0)
1.91 ++ (abort (), (__typeof(*mem)) 0)
1.92 +
1.93 + #define __arch_exchange_and_add_16_int(mem, newval, rel, acq) \
1.94 +- (abort (), (typeof(*mem)) 0)
1.95 ++ (abort (), (__typeof(*mem)) 0)
1.96 +
1.97 + #define __arch_exchange_and_add_32_int(mem, value, rel, acq) \
1.98 +-({ typeof (*mem) __prev; int __cmp; \
1.99 ++({ __typeof (*mem) __prev; int __cmp; \
1.100 + __asm__ __volatile__ ("\n" \
1.101 + ".set push\n\t" \
1.102 + MIPS_PUSH_MIPS2 \
1.103 +@@ -263,10 +263,10 @@
1.104 + #if _MIPS_SIM == _ABIO32
1.105 + /* We can't do an atomic 64-bit operation in O32. */
1.106 + #define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
1.107 +- (abort (), (typeof(*mem)) 0)
1.108 ++ (abort (), (__typeof(*mem)) 0)
1.109 + #else
1.110 + #define __arch_exchange_and_add_64_int(mem, value, rel, acq) \
1.111 +-({ typeof (*mem) __prev; int __cmp; \
1.112 ++({ __typeof (*mem) __prev; int __cmp; \
1.113 + __asm__ __volatile__ ( \
1.114 + ".set push\n\t" \
1.115 + MIPS_PUSH_MIPS2 \