CUBRID Engine  latest
ieeefp.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 #ifndef __CLASSPATH_IEEEFP_H__
19 #define __CLASSPATH_IEEEFP_H__
20 
21 #ifndef __IEEE_BIG_ENDIAN
22 #ifndef __IEEE_LITTLE_ENDIAN
23 
24 /*
25  * CUBRID local changes:
26  * check VC++ macros for CPU architecture
27  */
28 #ifdef _M_IX86 /* MSVC predefined macro definition for x86 CPUs */
29 # ifndef __i386__
30 # define __i386__ /* required by ieeefp.h in mprec.h */
31 # endif
32 #endif
33 
34 #ifdef _M_X64 /* MSVC predefined macro definition for x64 CPUs */
35 # ifndef __x86_64__
36 # define __x86_64__ /* required by ieeefp.h in mprec.h */
37 # endif
38 #endif
39 
40 
41 #ifdef __alpha__
42 #define __IEEE_LITTLE_ENDIAN
43 #endif
44 
45 #if defined(__arm__) || defined(__thumb__)
46 /* ARM traditionally used big-endian words; and within those words the
47  byte ordering was big or little endian depending upon the target.
48  Modern floating-point formats are naturally ordered; in this case
49  __VFP_FP__ will be defined, even if soft-float. */
50 #ifdef __VFP_FP__
51 #ifdef __ARMEL__
52 #define __IEEE_LITTLE_ENDIAN
53 #else
54 #define __IEEE_BIG_ENDIAN
55 #endif
56 #else
57 #define __IEEE_BIG_ENDIAN
58 #ifdef __ARMEL__
59 #define __IEEE_BYTES_LITTLE_ENDIAN
60 #endif
61 #endif
62 #endif
63 
64 #ifdef __hppa__
65 #define __IEEE_BIG_ENDIAN
66 #endif
67 
68 #if defined (__sparc) || defined (__sparc__)
69 #define __IEEE_BIG_ENDIAN
70 #endif
71 
72 #ifdef __m32r__
73 #ifdef __LITTLE_ENDIAN__
74 #define __IEEE_LITTLE_ENDIAN
75 #else
76 #define __IEEE_BIG_ENDIAN
77 #endif
78 #endif
79 
80 #if defined(__m68k__) || defined(__mc68000__)
81 #define __IEEE_BIG_ENDIAN
82 #endif
83 
84 #if defined (__H8300__) || defined (__H8300H__)
85 #define __IEEE_BIG_ENDIAN
86 #define __SMALL_BITFIELDS
87 #define _DOUBLE_IS_32BITS
88 #endif
89 
90 #ifdef __H8500__
91 #define __IEEE_BIG_ENDIAN
92 #define __SMALL_BITFIELDS
93 #define _DOUBLE_IS_32BITS
94 #endif
95 
96 #ifdef __sh__
97 #ifdef __LITTLE_ENDIAN__
98 #define __IEEE_LITTLE_ENDIAN
99 #else
100 #define __IEEE_BIG_ENDIAN
101 #endif
102 
103 #ifdef __SH3E__
104 #define _DOUBLE_IS_32BITS
105 #endif
106 #endif
107 
108 #ifdef _AM29K
109 #define __IEEE_BIG_ENDIAN
110 #endif
111 
112 #ifdef __i386__
113 #define __IEEE_LITTLE_ENDIAN
114 #endif
115 
116 #ifdef __x86_64__
117 #define __IEEE_LITTLE_ENDIAN
118 #endif
119 
120 #ifdef __i960__
121 #define __IEEE_LITTLE_ENDIAN
122 #endif
123 
124 #ifdef __AVR32__
125 #define __IEEE_BIG_ENDIAN
126 #endif
127 
128 #ifdef __MIPSEL__
129 #define __IEEE_LITTLE_ENDIAN
130 #endif
131 
132 #ifdef __MIPSEB__
133 #define __IEEE_BIG_ENDIAN
134 #endif
135 
136 #ifdef __pj__
137 #ifdef __pjl__
138 #define __IEEE_LITTLE_ENDIAN
139 #else
140 #define __IEEE_BIG_ENDIAN
141 #endif
142 #endif
143 
144 /* necv70 was __IEEE_LITTLE_ENDIAN. */
145 
146 #ifdef __W65__
147 #define __IEEE_LITTLE_ENDIAN
148 #define __SMALL_BITFIELDS
149 #define _DOUBLE_IS_32BITS
150 #endif
151 
152 #if defined(__Z8001__) || defined(__Z8002__)
153 #define __IEEE_BIG_ENDIAN
154 #endif
155 
156 #ifdef __m88k__
157 #define __IEEE_BIG_ENDIAN
158 #endif
159 
160 #ifdef __v800
161 #define __IEEE_LITTLE_ENDIAN
162 #endif
163 
164 #if defined (__PPC__) || defined (__ppc__) || defined (__powerpc__) || defined (__ppc64__) || defined (_POWER) || defined (_IBMR2)
165 #if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) || defined (__BIG_ENDIAN__)|| defined (__APPLE__)
166 #define __IEEE_BIG_ENDIAN
167 #else
168 #if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(__WIN32__) && __WIN32__)
169 #define __IEEE_LITTLE_ENDIAN
170 #endif
171 #endif
172 #endif
173 
174 #ifdef __fr30__
175 #define __IEEE_BIG_ENDIAN
176 #endif
177 
178 #ifdef __mcore__
179 #define __IEEE_BIG_ENDIAN
180 #endif
181 
182 
183 #ifdef __ia64__
184 #ifdef __BIG_ENDIAN__
185 #define __IEEE_BIG_ENDIAN
186 #else
187 #define __IEEE_LITTLE_ENDIAN
188 #endif
189 #endif
190 
191 #ifdef __s390__
192 #define __IEEE_BIG_ENDIAN
193 #endif
194 
195 #ifndef __IEEE_BIG_ENDIAN
196 #ifndef __IEEE_LITTLE_ENDIAN
197 #error Endianess not declared!!
198 #endif /* not __IEEE_LITTLE_ENDIAN */
199 #endif /* not __IEEE_BIG_ENDIAN */
200 
201 #endif /* not __IEEE_LITTLE_ENDIAN */
202 #endif /* not __IEEE_BIG_ENDIAN */
203 
204 #endif /* __CLASSPATH_IEEEFP_H__ */