Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 223 lines (206 sloc) 6.744 kB
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
1 /*************************************************************************
2 *
3 * $Id$
4 *
5 * Copyright (C) 2001 Bjorn Reese <breese@users.sourceforge.net>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
13 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
14 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
15 *
16 ************************************************************************/
17
026d29f Upgraded to trio baseline 1.6
Bjorn Reese authored
18 #ifndef TRIO_TRIODEF_H
19 #define TRIO_TRIODEF_H
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
20
21 /*************************************************************************
22 * Platform and compiler support detection
23 */
24 #if defined(__GNUC__)
25 # define TRIO_COMPILER_GCC
26 #elif defined(__SUNPRO_C)
27 # define TRIO_COMPILER_SUNPRO
28 #elif defined(__SUNPRO_CC)
29 # define TRIO_COMPILER_SUNPRO
30 # define __SUNPRO_C __SUNPRO_CC
31 #elif defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__)
32 # define TRIO_COMPILER_XLC
33 #elif defined(_AIX) && !defined(__GNUC__)
34 # define TRIO_COMPILER_XLC /* Workaround for old xlc */
35 #elif defined(__DECC) || defined(__DECCXX)
36 # define TRIO_COMPILER_DECC
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
37 #elif defined(__osf__) && defined(__LANGUAGE_C__)
38 # define TRIO_COMPILER_DECC /* Workaround for old DEC C compilers */
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
39 #elif defined(_MSC_VER)
40 # define TRIO_COMPILER_MSVC
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
41 #elif defined(__BORLANDC__)
42 # define TRIO_COMPILER_BCB
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
43 #endif
44
a48ed3d Bjorn sent an update for the TRIO portability layer. Daniel
Daniel Veillard authored
45 #if defined(VMS) || defined(__VMS)
46 /*
47 * VMS is placed first to avoid identifying the platform as Unix
48 * based on the DECC compiler later on.
49 */
50 # define TRIO_PLATFORM_VMS
51 #elif defined(unix) || defined(__unix) || defined(__unix__)
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
52 # define TRIO_PLATFORM_UNIX
53 #elif defined(TRIO_COMPILER_XLC) || defined(_AIX)
54 # define TRIO_PLATFORM_UNIX
a48ed3d Bjorn sent an update for the TRIO portability layer. Daniel
Daniel Veillard authored
55 #elif defined(TRIO_COMPILER_DECC) || defined(__osf___)
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
56 # define TRIO_PLATFORM_UNIX
57 #elif defined(__NetBSD__)
58 # define TRIO_PLATFORM_UNIX
f79fbfc applied patch from Olli Savia for LynxOS Daniel
Daniel Veillard authored
59 #elif defined(__Lynx__)
60 # define TRIO_PLATFORM_UNIX
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
61 #elif defined(__QNX__)
62 # define TRIO_PLATFORM_UNIX
026d29f Upgraded to trio baseline 1.6
Bjorn Reese authored
63 # define TRIO_PLATFORM_QNX
3c5ed91 Applied following patches from Robert Collins and make sure IN_LIBXML is
Daniel Veillard authored
64 #elif defined(__CYGWIN__)
65 # define TRIO_PLATFORM_UNIX
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
66 #elif defined(AMIGA) && defined(TRIO_COMPILER_GCC)
67 # define TRIO_PLATFORM_UNIX
68 #elif defined(TRIO_COMPILER_MSVC) || defined(WIN32) || defined(_WIN32)
69 # define TRIO_PLATFORM_WIN32
026d29f Upgraded to trio baseline 1.6
Bjorn Reese authored
70 #elif defined(mpeix) || defined(__mpexl)
71 # define TRIO_PLATFORM_MPEIX
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
72 #endif
73
a48ed3d Bjorn sent an update for the TRIO portability layer. Daniel
Daniel Veillard authored
74 #if defined(_AIX)
75 # define TRIO_PLATFORM_AIX
76 #elif defined(__hpux)
77 # define TRIO_PLATFORM_HPUX
78 #elif defined(sun) || defined(__sun__)
79 # if defined(__SVR4) || defined(__svr4__)
80 # define TRIO_PLATFORM_SOLARIS
81 # else
82 # define TRIO_PLATFORM_SUNOS
83 # endif
84 #endif
85
86 #if defined(__STDC__) || defined(TRIO_COMPILER_MSVC) || defined(TRIO_COMPILER_BCB)
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
87 # define TRIO_COMPILER_SUPPORTS_C89
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
88 # if defined(__STDC_VERSION__)
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
89 # define TRIO_COMPILER_SUPPORTS_C90
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
90 # if (__STDC_VERSION__ >= 199409L)
91 # define TRIO_COMPILER_SUPPORTS_C94
92 # endif
93 # if (__STDC_VERSION__ >= 199901L)
94 # define TRIO_COMPILER_SUPPORTS_C99
95 # endif
96 # elif defined(TRIO_COMPILER_SUNPRO)
97 # if (__SUNPRO_C >= 0x420)
98 # define TRIO_COMPILER_SUPPORTS_C94
99 # endif
100 # endif
101 #endif
102
103 #if defined(_XOPEN_SOURCE)
104 # if defined(_XOPEN_SOURCE_EXTENDED)
105 # define TRIO_COMPILER_SUPPORTS_UNIX95
106 # endif
107 # if (_XOPEN_VERSION >= 500)
108 # define TRIO_COMPILER_SUPPORTS_UNIX98
109 # endif
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
110 # if (_XOPEN_VERSION >= 600)
111 # define TRIO_COMPILER_SUPPORTS_UNIX01
112 # endif
4502960 Re-worked NaN and Inf support
Bjorn Reese authored
113 #endif
114
026d29f Upgraded to trio baseline 1.6
Bjorn Reese authored
115 /*************************************************************************
116 * Generic defines
117 */
118
119 #if !defined(TRIO_PUBLIC)
120 # define TRIO_PUBLIC
121 #endif
122 #if !defined(TRIO_PRIVATE)
123 # define TRIO_PRIVATE static
124 #endif
125
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
126 #if !(defined(TRIO_COMPILER_SUPPORTS_C89) || defined(__cplusplus))
127 # define TRIO_COMPILER_ANCIENT
128 #endif
129
130 #if defined(TRIO_COMPILER_ANCIENT)
026d29f Upgraded to trio baseline 1.6
Bjorn Reese authored
131 # define TRIO_CONST
132 # define TRIO_VOLATILE
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
133 # define TRIO_SIGNED
134 typedef double trio_long_double_t;
135 typedef char * trio_pointer_t;
136 # define TRIO_SUFFIX_LONG(x) x
026d29f Upgraded to trio baseline 1.6
Bjorn Reese authored
137 # define TRIO_PROTO(x) ()
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
138 # define TRIO_NOARGS
139 # define TRIO_ARGS1(list,a1) list a1;
140 # define TRIO_ARGS2(list,a1,a2) list a1; a2;
141 # define TRIO_ARGS3(list,a1,a2,a3) list a1; a2; a3;
142 # define TRIO_ARGS4(list,a1,a2,a3,a4) list a1; a2; a3; a4;
143 # define TRIO_ARGS5(list,a1,a2,a3,a4,a5) list a1; a2; a3; a4; a5;
144 # define TRIO_ARGS6(list,a1,a2,a3,a4,a5,a6) list a1; a2; a3; a4; a5; a6;
145 # define TRIO_VARGS2(list,a1,a2) list a1; a2
146 # define TRIO_VARGS3(list,a1,a2,a3) list a1; a2; a3
147 # define TRIO_VARGS4(list,a1,a2,a3,a4) list a1; a2; a3; a4
148 # define TRIO_VARGS5(list,a1,a2,a3,a4,a5) list a1; a2; a3; a4; a5
149 # define TRIO_VA_DECL va_dcl
a48ed3d Bjorn sent an update for the TRIO portability layer. Daniel
Daniel Veillard authored
150 # define TRIO_VA_START(x,y) va_start(x)
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
151 # define TRIO_VA_END(x) va_end(x)
152 #else /* ANSI C */
153 # define TRIO_CONST const
154 # define TRIO_VOLATILE volatile
155 # define TRIO_SIGNED signed
156 typedef long double trio_long_double_t;
157 typedef void * trio_pointer_t;
158 # define TRIO_SUFFIX_LONG(x) x ## L
159 # define TRIO_PROTO(x) x
160 # define TRIO_NOARGS void
161 # define TRIO_ARGS1(list,a1) (a1)
162 # define TRIO_ARGS2(list,a1,a2) (a1,a2)
163 # define TRIO_ARGS3(list,a1,a2,a3) (a1,a2,a3)
164 # define TRIO_ARGS4(list,a1,a2,a3,a4) (a1,a2,a3,a4)
165 # define TRIO_ARGS5(list,a1,a2,a3,a4,a5) (a1,a2,a3,a4,a5)
166 # define TRIO_ARGS6(list,a1,a2,a3,a4,a5,a6) (a1,a2,a3,a4,a5,a6)
167 # define TRIO_VARGS2 TRIO_ARGS2
168 # define TRIO_VARGS3 TRIO_ARGS3
169 # define TRIO_VARGS4 TRIO_ARGS4
170 # define TRIO_VARGS5 TRIO_ARGS5
171 # define TRIO_VA_DECL ...
a48ed3d Bjorn sent an update for the TRIO portability layer. Daniel
Daniel Veillard authored
172 # define TRIO_VA_START(x,y) va_start(x,y)
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
173 # define TRIO_VA_END(x) va_end(x)
026d29f Upgraded to trio baseline 1.6
Bjorn Reese authored
174 #endif
175
176 #if defined(TRIO_COMPILER_SUPPORTS_C99) || defined(__cplusplus)
177 # define TRIO_INLINE inline
178 #elif defined(TRIO_COMPILER_GCC)
179 # define TRIO_INLINE __inline__
b7c29c3 applied a trio update patch from Bjorn Reese which should work with M…
Daniel Veillard authored
180 #elif defined(TRIO_COMPILER_MSVC)
181 # define TRIO_INLINE _inline
182 #elif defined(TRIO_COMPILER_BCB)
183 # define TRIO_INLINE __inline
026d29f Upgraded to trio baseline 1.6
Bjorn Reese authored
184 #else
185 # define TRIO_INLINE
186 #endif
187
a48ed3d Bjorn sent an update for the TRIO portability layer. Daniel
Daniel Veillard authored
188 /*************************************************************************
189 * Workarounds
190 */
191
192 #if defined(TRIO_PLATFORM_VMS)
193 /*
194 * Computations done with constants at compile time can trigger these
195 * even when compiling with IEEE enabled.
196 */
197 # pragma message disable (UNDERFLOW, FLOATOVERFL)
198
1c96027 applied patch from Craig A. Berry to get libxml-2.5.7 to compile on
Daniel Veillard authored
199 # if (__CRTL_VER < 80000000)
a48ed3d Bjorn sent an update for the TRIO portability layer. Daniel
Daniel Veillard authored
200 /*
201 * Although the compiler supports C99 language constructs, the C
202 * run-time library does not contain all C99 functions.
203 *
204 * This was the case for 70300022. Update the 80000000 value when
205 * it has been accurately determined what version of the library
206 * supports C99.
207 */
208 # if defined(TRIO_COMPILER_SUPPORTS_C99)
209 # undef TRIO_COMPILER_SUPPORTS_C99
210 # endif
211 # endif
212 #endif
213
214 /*
215 * Not all preprocessors supports the LL token.
216 */
217 #if defined(TRIO_COMPILER_BCB)
218 #else
219 # define TRIO_COMPILER_SUPPORTS_LL
220 #endif
221
026d29f Upgraded to trio baseline 1.6
Bjorn Reese authored
222 #endif /* TRIO_TRIODEF_H */
Something went wrong with that request. Please try again.