uClibc-0.9.28-math-endianness.patch 6.9 KB

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