Bug 1909234 - Fix non-unified bustage by including <map> directly in FrameTransformer...
[gecko.git] / modules / fdlibm / patches / 06_use_mfbt_endian_h_in_math_private_h.patch
blobb4374fc948eb3cab8c05a7a101e7ab82e92a5d35
1 diff --git a/math_private.h b/math_private.h
2 --- a/math_private.h
3 +++ b/math_private.h
4 @@ -14,52 +14,38 @@
5 * $FreeBSD$
6 */
8 #ifndef _MATH_PRIVATE_H_
9 #define _MATH_PRIVATE_H_
11 #include <stdint.h>
12 #include <sys/types.h>
13 -#include <machine/endian.h>
15 +#include "mozilla/EndianUtils.h"
17 #include "fdlibm.h"
20 * The original fdlibm code used statements like:
21 * n0 = ((*(int*)&one)>>29)^1; * index of high word *
22 * ix0 = *(n0+(int*)&x); * high word of x *
23 * ix1 = *((1-n0)+(int*)&x); * low word of x *
24 * to dig two 32 bit words out of the 64 bit IEEE floating point
25 * value. That is non-ANSI, and, moreover, the gcc instruction
26 * scheduler gets it wrong. We instead use the following macros.
27 * Unlike the original code, we determine the endianness at compile
28 * time, not at run time; I don't see much benefit to selecting
29 * endianness at run time.
32 -/*
33 - * A union which permits us to convert between a double and two 32 bit
34 - * ints.
35 - */
37 -#ifdef __arm__
38 -#if defined(__VFP_FP__) || defined(__ARM_EABI__)
39 -#define IEEE_WORD_ORDER BYTE_ORDER
40 -#else
41 -#define IEEE_WORD_ORDER BIG_ENDIAN
42 -#endif
43 -#else /* __arm__ */
44 -#define IEEE_WORD_ORDER BYTE_ORDER
45 -#endif
47 /* A union which permits us to convert between a long double and
48 four 32 bit ints. */
50 -#if IEEE_WORD_ORDER == BIG_ENDIAN
51 +#if MOZ_BIG_ENDIAN()
53 typedef union
55 long double value;
56 struct {
57 u_int32_t mswhi;
58 u_int32_t mswlo;
59 u_int32_t lswhi;
60 @@ -68,17 +54,17 @@ typedef union
61 struct {
62 u_int64_t msw;
63 u_int64_t lsw;
64 } parts64;
65 } ieee_quad_shape_type;
67 #endif
69 -#if IEEE_WORD_ORDER == LITTLE_ENDIAN
70 +#if MOZ_LITTLE_ENDIAN()
72 typedef union
74 long double value;
75 struct {
76 u_int32_t lswlo;
77 u_int32_t lswhi;
78 u_int32_t mswlo;
79 @@ -87,17 +73,17 @@ typedef union
80 struct {
81 u_int64_t lsw;
82 u_int64_t msw;
83 } parts64;
84 } ieee_quad_shape_type;
86 #endif
88 -#if IEEE_WORD_ORDER == BIG_ENDIAN
89 +#if MOZ_BIG_ENDIAN()
91 typedef union
93 double value;
94 struct
96 u_int32_t msw;
97 u_int32_t lsw;
98 @@ -105,17 +91,17 @@ typedef union
99 struct
101 u_int64_t w;
102 } xparts;
103 } ieee_double_shape_type;
105 #endif
107 -#if IEEE_WORD_ORDER == LITTLE_ENDIAN
108 +#if MOZ_LITTLE_ENDIAN()
110 typedef union
112 double value;
113 struct
115 u_int32_t lsw;
116 u_int32_t msw;