bump version
[buildroot.git] / toolchain / uClibc / uClibc-0.9.28-math-endianness.patch
blob015f795687a392eed1d4f8cc7a4a17d5f4d39ff9
1 Index: uclibc/libm/fp_private.h
2 ===================================================================
3 --- uclibc/libm/fp_private.h (revision 12879)
4 +++ uclibc/libm/fp_private.h (working copy)
5 @@ -70,10 +70,11 @@
6 *******************************************************************************/
8 #include <stdint.h>
9 +#include <endian.h>
11 typedef struct /* Hex representation of a double. */
13 -#if defined(__BIG_ENDIAN__)
14 +#if (__BYTE_ORDER == __BIG_ENDIAN)
15 uint32_t high;
16 uint32_t low;
17 #else
18 Index: uclibc/libm/powerpc/s_ceil.c
19 ===================================================================
20 --- uclibc/libm/powerpc/s_ceil.c (revision 12879)
21 +++ uclibc/libm/powerpc/s_ceil.c (working copy)
22 @@ -21,13 +21,15 @@
23 * *
24 *******************************************************************************/
26 +#include <endian.h>
28 static const double twoTo52 = 4503599627370496.0;
29 static const unsigned long signMask = 0x80000000ul;
31 typedef union
33 struct {
34 -#if defined(__BIG_ENDIAN__)
35 +#if (__BYTE_ORDER == __BIG_ENDIAN)
36 unsigned long int hi;
37 unsigned long int lo;
38 #else
39 Index: uclibc/libm/powerpc/s_ldexp.c
40 ===================================================================
41 --- uclibc/libm/powerpc/s_ldexp.c (revision 12879)
42 +++ uclibc/libm/powerpc/s_ldexp.c (working copy)
43 @@ -21,11 +21,12 @@
45 #include <limits.h>
46 #include <math.h>
47 +#include <endian.h>
49 typedef union
51 struct {
52 -#if defined(__BIG_ENDIAN__)
53 +#if (__BYTE_ORDER == __BIG_ENDIAN)
54 unsigned long int hi;
55 unsigned long int lo;
56 #else
57 Index: uclibc/libm/powerpc/s_rint.c
58 ===================================================================
59 --- uclibc/libm/powerpc/s_rint.c (revision 12879)
60 +++ uclibc/libm/powerpc/s_rint.c (working copy)
61 @@ -46,13 +46,14 @@
63 #include <limits.h>
64 #include <math.h>
65 +#include <endian.h>
67 #define SET_INVALID 0x01000000UL
69 typedef union
71 struct {
72 -#if defined(__BIG_ENDIAN__)
73 +#if (__BYTE_ORDER == __BIG_ENDIAN)
74 unsigned long int hi;
75 unsigned long int lo;
76 #else
77 Index: uclibc/libm/powerpc/s_floor.c
78 ===================================================================
79 --- uclibc/libm/powerpc/s_floor.c (revision 12879)
80 +++ uclibc/libm/powerpc/s_floor.c (working copy)
81 @@ -21,13 +21,15 @@
82 * *
83 *******************************************************************************/
85 +#include <endian.h>
87 static const double twoTo52 = 4503599627370496.0;
88 static const unsigned long signMask = 0x80000000ul;
90 typedef union
92 struct {
93 -#if defined(__BIG_ENDIAN__)
94 +#if (__BYTE_ORDER == __BIG_ENDIAN)
95 unsigned long int hi;
96 unsigned long int lo;
97 #else
98 Index: uclibc/libm/powerpc/s_logb.c
99 ===================================================================
100 --- uclibc/libm/powerpc/s_logb.c (revision 12879)
101 +++ uclibc/libm/powerpc/s_logb.c (working copy)
102 @@ -32,10 +32,12 @@
103 * Standard 754. *
104 *******************************************************************************/
106 +#include <endian.h>
108 typedef union
110 struct {
111 -#if defined(__BIG_ENDIAN__)
112 +#if (__BYTE_ORDER == __BIG_ENDIAN)
113 unsigned long int hi;
114 unsigned long int lo;
115 #else
116 Index: uclibc/libm/powerpc/s_frexp.c
117 ===================================================================
118 --- uclibc/libm/powerpc/s_frexp.c (revision 12879)
119 +++ uclibc/libm/powerpc/s_frexp.c (working copy)
120 @@ -21,13 +21,14 @@
122 #include <limits.h>
123 #include <math.h>
124 +#include <endian.h>
126 static const double two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */
128 typedef union
130 struct {
131 -#if defined(__BIG_ENDIAN__)
132 +#if (__BYTE_ORDER == __BIG_ENDIAN)
133 unsigned long int hi;
134 unsigned long int lo;
135 #else
136 Index: uclibc/libm/powerpc/s_modf.c
137 ===================================================================
138 --- uclibc/libm/powerpc/s_modf.c (revision 12879)
139 +++ uclibc/libm/powerpc/s_modf.c (working copy)
140 @@ -45,13 +45,14 @@
142 #include <limits.h>
143 #include <math.h>
144 +#include <endian.h>
146 #define SET_INVALID 0x01000000UL
148 typedef union
150 struct {
151 -#if defined(__BIG_ENDIAN__)
152 +#if (__BYTE_ORDER == __BIG_ENDIAN)
153 unsigned long int hi;
154 unsigned long int lo;
155 #else
156 Index: uclibc/libm/powerpc/w_scalb.c
157 ===================================================================
158 --- uclibc/libm/powerpc/w_scalb.c (revision 12879)
159 +++ uclibc/libm/powerpc/w_scalb.c (working copy)
160 @@ -19,10 +19,12 @@
162 ***********************************************************************/
164 +#include <endian.h>
166 typedef union
168 struct {
169 -#if defined(__BIG_ENDIAN__)
170 +#if (__BYTE_ORDER == __BIG_ENDIAN)
171 unsigned long int hi;
172 unsigned long int lo;
173 #else
174 Index: uclibc/libc/string/sh64/strcpy.S
175 ===================================================================
176 --- uclibc/libc/string/sh64/strcpy.S (revision 12879)
177 +++ uclibc/libc/string/sh64/strcpy.S (working copy)
178 @@ -6,7 +6,9 @@
180 ! SH5 code Copyright 2002 SuperH Ltd.
182 -#ifdef __LITTLE_ENDIAN__
183 +#include <endian.h>
185 +#if __BYTE_ORDER == __LITTLE_ENDIAN
186 #define SHHI shlld
187 #define SHLO shlrd
188 #else
189 @@ -67,7 +69,7 @@
190 add r5, r63, r4
191 addi r0, 8, r0
192 shortstring:
193 -#ifndef __LITTLE_ENDIAN__
194 +#if __BYTE_ORDER != __LITTLE_ENDIAN
195 pta/l shortstring2,tr1
196 byterev r4,r4
197 #endif
198 Index: uclibc/libc/string/sh64/memset.S
199 ===================================================================
200 --- uclibc/libc/string/sh64/memset.S (revision 12879)
201 +++ uclibc/libc/string/sh64/memset.S (working copy)
202 @@ -9,7 +9,9 @@
203 ! Copyright 2002 SuperH Ltd.
206 -#ifdef __LITTLE_ENDIAN__
207 +#include <endian.h>
209 +#if __BYTE_ORDER == __LITTLE_ENDIAN
210 #define SHHI shlld
211 #define SHLO shlrd
212 #else
213 Index: uclibc/libc/sysdeps/linux/sh/bits/kernel_stat.h
214 ===================================================================
215 --- uclibc/libc/sysdeps/linux/sh/bits/kernel_stat.h (revision 12879)
216 +++ uclibc/libc/sysdeps/linux/sh/bits/kernel_stat.h (working copy)
217 @@ -30,10 +30,10 @@
220 struct kernel_stat64 {
221 -#if defined(__BIG_ENDIAN__)
222 +#if (__BYTE_ORDER == __BIG_ENDIAN)
223 unsigned char __pad0b[6];
224 unsigned short st_dev;
225 -#elif defined(__LITTLE_ENDIAN__)
226 +#elif (__BYTE_ORDER == __LITTLE_ENDIAN)
227 unsigned short st_dev;
228 unsigned char __pad0b[6];
229 #else
230 @@ -48,7 +48,7 @@
231 unsigned long st_uid;
232 unsigned long st_gid;
234 -#if defined(__BIG_ENDIAN__)
235 +#if (__BYTE_ORDER == __BIG_ENDIAN)
236 unsigned char __pad3b[6];
237 unsigned short st_rdev;
238 #else /* Must be little */
239 @@ -60,7 +60,7 @@
240 long long st_size;
241 unsigned long st_blksize;
243 -#if defined(__BIG_ENDIAN__)
244 +#if (__BYTE_ORDER == __BIG_ENDIAN)
245 unsigned long __pad4; /* Future possible st_blocks hi bits */
246 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
247 #else /* Must be little */