gpp4  1.3.1
ccp4_sysdep.h
Go to the documentation of this file.
1 /*
2  ccp4_sysdep.h: System-dependent definitions
3  Copyright (C) 2001 CCLRC
4 
5  This library is free software: you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation, either
8  version 3 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with This library. If not, see
17  <http://www.gnu.org/licenses/>.
18 
19 */
20 
28 #ifndef __CCP4_BITS
29 #define __CCP4_BITS
30 
31 #if defined (_AIX) || defined(___AIX)
32 # define KNOWN_MACHINE
33 # define CALL_LIKE_HPUX 1
34 #endif
35 
36 #if defined (__hpux)
37 # define KNOWN_MACHINE
38 # define CALL_LIKE_HPUX 1
39 #endif
40 
41 #ifdef __sgi /* in ANSI mode */
42 # ifndef sgi
43 # define sgi
44 # endif
45 #endif
46 
47 #if defined (sgi)
48 # define KNOWN_MACHINE
49 # define CALL_LIKE_SUN 1
50 #endif
51 
52 #if defined (sun) || defined (__sun)
53 # define KNOWN_MACHINE
54 # define CALL_LIKE_SUN 1
55 # if !defined(__STDC__) || defined(__GNUC__)
56 # if !defined(G77)
57  extern char *sys_errlist [];
58 # define strerror(i) sys_errlist[i] /* k&r compiler doesn't have it */
59 # endif
60 # endif
61 #endif
62 
63 #if defined(__OSF1__) || defined(__osf__)
64 # define KNOWN_MACHINE
65 # define CALL_LIKE_SUN 1
66 #endif
67 
68 #ifndef VMS
69 # if defined (vms) || defined (__vms) || defined (__VMS)
70 # define VMS
71 # endif
72 #endif
73 #if defined (VMS)
74 # define KNOWN_MACHINE
75 # define CALL_LIKE_VMS 1
76 #endif
77 
78 #if defined(_MSC_VER) || defined (WIN32)
79 # if defined (_MSC_VER) && (_MSC_VER >= 800)
80 # define CALL_LIKE_MVS 2
81 # else
82 # define CALL_LIKE_MVS 1
83 # endif
84 # define KNOWN_MACHINE
85 #endif
86 
87 #if defined (linux) || defined __linux__ || defined (__CYGWIN__)
88 # undef CALL_LIKE_SUN
89 # define KNOWN_MACHINE
90 # define CALL_LIKE_SUN 1
91 #endif
92 
93 #if defined __linux__ && ( defined __PPC || defined __PPC__ )
94 # undef CALL_LIKE_SUN
95 # define KNOWN_MACHINE
96 # define CALL_LIKE_SUN 1
97 #endif
98 
99 #if defined (__FreeBSD__)
100 # undef CALL_LIKE_SUN
101 # define KNOWN_MACHINE
102 # define CALL_LIKE_SUN 1
103 #endif
104 
105 #if defined(F2C) || defined(G77)
106 # undef CALL_LIKE_SUN
107 # define CALL_LIKE_SUN 1
108 # define KNOWN_MACHINE
109 #endif
110 
111 #if defined(__APPLE__)
112 # undef CALL_LIKE_SUN
113 # define CALL_LIKE_SUN 1
114 # define KNOWN_MACHINE
115 #endif
116 
117 #if defined (_CALL_SYSV) && ! defined (__APPLE__)
118 # undef CALL_LIKE_SUN
119 # define CALL_LIKE_SUN 1
120 # define KNOWN_MACHINE
121 #endif
122 
123 #if ! defined (KNOWN_MACHINE)
124 # error System type is not known -- see the Installation Guide
125 #else
126 
127 #ifndef _POSIX_SOURCE
128 #define _POSIX_SOURCE
129 #endif
130 
131 /* include X/Open Unix extensions (e.g. cuserid) */
132 #ifndef _XOPEN_SOURCE
133 #define _XOPEN_SOURCE
134 #endif
135 
136 #include <stdio.h>
137 
138 #if defined (VMS)
139 # include <descrip.h> /* non-POSIX */
140 # define NOUNISTD
141 #else
142 # include <sys/types.h>
143 # include <sys/stat.h>
144 # if !defined (_WIN32) && !defined (_MSC_VER)
145 # include <sys/times.h>
146 # endif
147 # ifdef _MSC_VER
148 # define NOUNISTD
149 # endif
150 #endif
151 
152 #include <stddef.h>
153 #include <string.h>
154 
155 #ifndef NOUNISTD
156 # include <unistd.h>
157 #else
158 # ifndef VMS
159 # ifndef _MSC_VER
160 # include <sys/file.h> /* ESV, old Concentrix */ /* non-POSIX */
161 # endif
162 # endif
163 #endif
164 #ifndef NOSTDLIB /* for TitanOS 4.2, at least? */
165 # include <stdlib.h>
166 #endif
167 
168 #include <errno.h>
169 #include <ctype.h>
170 
171 #if defined(_AIX) || defined (__hpux) || defined(F2C) ||\
172  defined(G77) || defined(_WIN32) || defined (sun) /* would do no harm on others, though */
173 # include <time.h>
174 #endif
175 
176 #include <limits.h>
177 #include <float.h>
178 
179 #if defined (F2C)
180 # define Skip_f2c_Undefs
181 # include "f2c.h"
182 #endif
183 #if defined (G77)
184 # define Skip_f2c_Undefs /* g2c.h infelicity... */
185 # if defined (HAVE_G2C_H)
186 # include "g2c.h"
187 # endif
188 #endif
189 
190 /* rint() function does not seen to exist for mingw32
191  defined in library_utils.c */
192 # if ((defined _WIN32) || (defined _MSC_VER)) && (!defined rint)
193  double rint(double x);
194 #endif
195 
196 #ifdef _MSC_VER
197 #define M_PI 3.14159265358979323846
198 #endif
199 
200 #ifdef _MSC_VER
201 # define PATH_SEPARATOR '\\'
202 # define EXT_SEPARATOR '.'
203 #else
204 # define PATH_SEPARATOR '/'
205 # define EXT_SEPARATOR '.'
206 #endif
207 
208 #define MAXFLEN 512
209 #define MAXFILES 16
210 #define DEFMODE 2
212 #define IRRELEVANT_OP 0
213 #define READ_OP 1
214 #define WRITE_OP 2
215 
216 #include<fcntl.h>
217 #ifndef SEEK_SET
218 # define SEEK_SET 0
219 # define SEEK_CUR 1
220 # define SEEK_END 2
221 #endif /* ! SEEK_SET */
222 #ifndef O_WRONLY
223 #define O_RDONLY 0x0000
224 #define O_WRONLY 0x0001
225 #define O_RDWR 0x0002
226 #define O_APPEND 0x0008
227 #define O_CREAT 0x0200
228 #define O_TRUNC 0x0400
229 #endif
230 #define O_TMP 0x0010
232 #define BYTE 0
233 #define INT16 1
234 #define INT32 6
235 #define FLOAT32 2
236 #define COMP32 3
237 #define COMP64 4
238 
239 #define DFNTI_MBO 1
240 #define DFNTI_IBO 4
242 #define DFNTF_BEIEEE 1
243 #define DFNTF_VAX 2
244 #define DFNTF_CONVEXNATIVE 5
245 #define DFNTF_LEIEEE 4
247 #if defined (VAX) || defined (vax) /* gcc seems to use vax */
248 # define NATIVEFT DFNTF_VAX
249 # define NATIVEIT DFNTI_IBO
250 #endif
251 
252 #if defined(MIPSEL) || defined(i386) || defined(i860) || defined(__ia64__) || defined(__amd64__) || defined(__x86_64__) || defined(WIN32)
253 # define NATIVEIT DFNTI_IBO
254 # define NATIVEFT DFNTF_LEIEEE
255 #endif
256 
257 #if defined(__ARMEL__)
258 # define NATIVEIT DFNTI_IBO
259 # define NATIVEFT DFNTF_LEIEEE
260 #endif
261 
262 #if defined (powerpc) || defined (__powerpc__) || defined (__ppc__) || defined __PPC
263 # define NATIVEIT DFNTI_MBO
264 # define NATIVEFT DFNTF_BEIEEE
265 #endif
266 
267 #if defined (__s390__) || defined (__s390x__)
268 # define NATIVEIT DFNTI_MBO
269 # define NATIVEFT DFNTF_BEIEEE
270 #endif
271 
272 #ifdef __alpha
273 # ifdef VMS
274 # if __IEEE_FLOAT == 1
275 # define NATIVEFT DFNTF_LEIEEE
276 # else
277 # define NATIVEFT DFNTF_VAX
278 # endif
279 # else /* assume OSF/1 */
280 # define NATIVEFT DFNTF_LEIEEE
281 # endif
282 # define NATIVEIT DFNTI_IBO
283 #endif
284 
285 #if defined(MIPSEB) || defined(__hpux) || defined(_AIX) || defined(m68k) || defined(mc68000) || defined(sparc) || defined (__sparc__)
286 # define NATIVEIT DFNTI_MBO
287 # define NATIVEFT DFNTF_BEIEEE
288 #endif
289 
290 #if defined (__hppa__)
291 # define NATIVEIT DFNTI_MBO
292 # define NATIVEFT DFNTF_BEIEEE
293 #endif
294 
295 #if defined(__ARM__) || defined(__arm__)
296 #if defined(__ARMEB__)
297 # define NATIVEIT DFNTI_MBO
298 # define NATIVEFT DFNTF_BEIEEE
299 #endif
300 #if defined(__ARMEL__)
301 # define NATIVEIT DFNTI_IBO
302 # define NATIVEFT DFNTF_LEIEEE
303 #endif
304 #endif
305 
306 #ifndef NATIVEFT
307 # error "Can't determine machine number format"
308 #endif
309 
310 #define DFNT_UINT 0
311 #define DFNT_SINT 1
312 #define DFNT_INT 2
313 #define DFNT_UCHAR 3
314 #define DFNT_CHAR 4
315 #define DFNT_FLOAT 5
316 #define DFNT_DOUBLE 6
318 #endif
319 
320 #endif /* __CCP4_BITS */
321 
322 /*
323  Local variables:
324  mode: font-lock
325  End:
326 */