gpp4 1.3.1

src/ccp4_sysdep.h

Go to the documentation of this file.
00001 /*
00002      ccp4_sysdep.h: System-dependent definitions
00003      Copyright (C) 2001  CCLRC
00004 
00005      This library is free software: you can redistribute it and/or
00006      modify it under the terms of the GNU Lesser General Public
00007      License as published by the Free Software Foundation, either
00008      version 3 of the License, or (at your option) any later version.
00009 
00010      This library is distributed in the hope that it will be useful,
00011      but WITHOUT ANY WARRANTY; without even the implied warranty of
00012      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013      Lesser General Public License for more details.
00014 
00015      You should have received a copy of the GNU Lesser General Public
00016      License along with This library.  If not, see
00017      <http://www.gnu.org/licenses/>.
00018 
00019 */
00020 
00028 #ifndef __CCP4_BITS
00029 #define __CCP4_BITS
00030 
00031 #if defined (_AIX) || defined(___AIX)
00032 #  define KNOWN_MACHINE
00033 #  define CALL_LIKE_HPUX 1
00034 #endif
00035 
00036 #if defined (__hpux) 
00037 #  define KNOWN_MACHINE
00038 #  define CALL_LIKE_HPUX 1
00039 #endif
00040 
00041 #ifdef __sgi   /* in ANSI mode */
00042 #  ifndef sgi
00043 #    define sgi
00044 #  endif
00045 #endif
00046 
00047 #if defined (sgi)
00048 #  define KNOWN_MACHINE
00049 #  define CALL_LIKE_SUN 1
00050 #endif
00051 
00052 #if defined (sun) || defined (__sun)
00053 #  define KNOWN_MACHINE
00054 #  define CALL_LIKE_SUN 1
00055 #  if !defined(__STDC__) || defined(__GNUC__)
00056 #    if !defined(G77)
00057       extern char *sys_errlist [];
00058 #     define strerror(i) sys_errlist[i] /* k&r compiler doesn't have it */
00059 #    endif
00060 #  endif
00061 #endif
00062 
00063 #if defined(__OSF1__) || defined(__osf__)
00064 #  define KNOWN_MACHINE
00065 #  define CALL_LIKE_SUN 1
00066 #endif
00067 
00068 #ifndef VMS
00069 #  if defined (vms) || defined (__vms) || defined (__VMS)
00070 #    define VMS
00071 #  endif
00072 #endif
00073 #if defined (VMS)
00074 #  define KNOWN_MACHINE
00075 #  define CALL_LIKE_VMS 1
00076 #endif
00077 
00078 #if defined(_MSC_VER) || defined (WIN32)
00079 # if defined (_MSC_VER) && (_MSC_VER >= 800)
00080 #  define CALL_LIKE_MVS 2
00081 # else
00082 #  define CALL_LIKE_MVS 1
00083 # endif
00084 #  define KNOWN_MACHINE
00085 #endif
00086 
00087 #if defined (linux) || defined __linux__ || defined (__CYGWIN__)
00088 #  undef CALL_LIKE_SUN
00089 #  define KNOWN_MACHINE
00090 #  define CALL_LIKE_SUN 1
00091 #endif
00092 
00093 #if defined __linux__ && ( defined __PPC || defined __PPC__ )
00094 #  undef CALL_LIKE_SUN
00095 #  define KNOWN_MACHINE
00096 #  define CALL_LIKE_SUN 1
00097 #endif
00098 
00099 #if defined (__FreeBSD__)
00100 #  undef CALL_LIKE_SUN
00101 #  define KNOWN_MACHINE
00102 #  define CALL_LIKE_SUN 1
00103 #endif
00104 
00105 #if defined(F2C) || defined(G77)
00106 #  undef CALL_LIKE_SUN
00107 #  define CALL_LIKE_SUN 1
00108 #  define KNOWN_MACHINE
00109 #endif
00110 
00111 #if defined(__APPLE__)
00112 #  undef CALL_LIKE_SUN
00113 #  define CALL_LIKE_SUN 1
00114 #  define KNOWN_MACHINE
00115 #endif
00116 
00117 #if defined (_CALL_SYSV) && ! defined (__APPLE__)
00118 #  undef CALL_LIKE_SUN
00119 #  define CALL_LIKE_SUN 1
00120 #  define KNOWN_MACHINE
00121 #endif
00122 
00123 #if ! defined (KNOWN_MACHINE)
00124 #  error System type is not known -- see the Installation Guide
00125 #else
00126 
00127 #ifndef _POSIX_SOURCE
00128 #define _POSIX_SOURCE
00129 #endif
00130 
00131 /* include X/Open Unix extensions (e.g. cuserid) */
00132 #ifndef _XOPEN_SOURCE
00133 #define _XOPEN_SOURCE
00134 #endif
00135 
00136 #include <stdio.h>
00137 
00138 #if defined (VMS)
00139 #  include <descrip.h>          /* non-POSIX */
00140 #  define NOUNISTD
00141 #else
00142 #  include <sys/types.h>
00143 #  include <sys/stat.h>
00144 #  if !defined (_WIN32) && !defined (_MSC_VER)
00145 #    include <sys/times.h>
00146 #  endif
00147 #  ifdef _MSC_VER
00148 #    define NOUNISTD
00149 #  endif
00150 #endif
00151 
00152 #include <stddef.h>
00153 #include <string.h>
00154 
00155 #ifndef NOUNISTD
00156 #  include <unistd.h>
00157 #else
00158 #  ifndef VMS 
00159 #    ifndef _MSC_VER
00160 #      include <sys/file.h>     /* ESV, old Concentrix */ /* non-POSIX */
00161 #    endif
00162 #  endif
00163 #endif
00164 #ifndef NOSTDLIB                /* for TitanOS 4.2, at least? */
00165 #  include <stdlib.h>
00166 #endif
00167 
00168 #include <errno.h>
00169 #include <ctype.h>
00170 
00171 #if defined(_AIX) || defined (__hpux) || defined(F2C) ||\
00172     defined(G77) || defined(_WIN32) || defined (sun) /* would do no harm on others, though */
00173 #  include <time.h>
00174 #endif
00175 
00176 #include <limits.h>
00177 #include <float.h>
00178 
00179 #if defined (F2C)
00180 #  define Skip_f2c_Undefs
00181 #  include "f2c.h"
00182 #endif
00183 #if defined (G77)
00184 #  define Skip_f2c_Undefs       /* g2c.h infelicity... */
00185 #  if defined (HAVE_G2C_H)
00186 #    include "g2c.h"
00187 #  endif
00188 #endif
00189 
00190 /* rint() function does not seen to exist for mingw32
00191    defined in library_utils.c */
00192 #  if ((defined _WIN32) || (defined _MSC_VER)) && (!defined rint)
00193   double rint(double x);
00194 #endif
00195 
00196 #ifdef _MSC_VER
00197 #define  M_PI            3.14159265358979323846
00198 #endif
00199 
00200 #ifdef _MSC_VER
00201 #  define PATH_SEPARATOR '\\'
00202 #  define EXT_SEPARATOR '.'
00203 #else
00204 #  define PATH_SEPARATOR '/'
00205 #  define EXT_SEPARATOR '.'
00206 #endif
00207 
00208 #define MAXFLEN       512    
00209 #define MAXFILES       16    
00210 #define DEFMODE         2    
00212 #define IRRELEVANT_OP   0
00213 #define READ_OP         1
00214 #define WRITE_OP        2
00215 
00216 #include<fcntl.h>
00217 #ifndef SEEK_SET
00218 #  define SEEK_SET 0
00219 #  define SEEK_CUR 1
00220 #  define SEEK_END 2
00221 #endif /* ! SEEK_SET */
00222 #ifndef O_WRONLY
00223 #define O_RDONLY 0x0000       
00224 #define O_WRONLY 0x0001       
00225 #define O_RDWR   0x0002       
00226 #define O_APPEND 0x0008       
00227 #define O_CREAT  0x0200       
00228 #define O_TRUNC  0x0400       
00229 #endif
00230 #define O_TMP    0x0010       
00232 #define BYTE  0
00233 #define INT16 1   
00234 #define INT32 6
00235 #define FLOAT32 2
00236 #define COMP32  3
00237 #define COMP64  4
00238 
00239 #define DFNTI_MBO       1       
00240 #define DFNTI_IBO       4       
00242 #define DFNTF_BEIEEE    1       
00243 #define DFNTF_VAX       2       
00244 #define DFNTF_CONVEXNATIVE 5    
00245 #define DFNTF_LEIEEE    4       
00247 #if defined (VAX) || defined (vax) /* gcc seems to use vax */
00248 #  define NATIVEFT DFNTF_VAX
00249 #  define NATIVEIT DFNTI_IBO
00250 #endif
00251 
00252 #if defined(MIPSEL) || defined(i386) || defined(i860) || defined(__ia64__) || defined(__amd64__) || defined(__x86_64__) || defined(WIN32)
00253 #  define NATIVEIT DFNTI_IBO
00254 #  define NATIVEFT DFNTF_LEIEEE
00255 #endif
00256 
00257 #if defined(__ARMEL__)
00258 #  define NATIVEIT DFNTI_IBO
00259 #  define NATIVEFT DFNTF_LEIEEE
00260 #endif
00261 
00262 #if defined (powerpc) || defined (__powerpc__) || defined (__ppc__) || defined __PPC
00263 #  define NATIVEIT DFNTI_MBO
00264 #  define NATIVEFT DFNTF_BEIEEE
00265 #endif
00266 
00267 #if defined (__s390__) || defined (__s390x__)
00268 #  define NATIVEIT DFNTI_MBO
00269 #  define NATIVEFT DFNTF_BEIEEE
00270 #endif
00271 
00272 #ifdef __alpha
00273 #  ifdef VMS
00274 #    if __IEEE_FLOAT == 1
00275 #      define NATIVEFT DFNTF_LEIEEE
00276 #    else
00277 #      define NATIVEFT DFNTF_VAX
00278 #    endif
00279 #  else                       /* assume OSF/1 */
00280 #    define NATIVEFT DFNTF_LEIEEE
00281 #  endif
00282 #  define NATIVEIT DFNTI_IBO
00283 #endif
00284 
00285 #if defined(MIPSEB) || defined(__hpux) || defined(_AIX) || defined(m68k) || defined(mc68000) || defined(sparc) || defined (__sparc__)
00286 #  define NATIVEIT DFNTI_MBO
00287 #  define NATIVEFT DFNTF_BEIEEE
00288 #endif
00289 
00290 #if defined (__hppa__)
00291 #  define NATIVEIT DFNTI_MBO
00292 #  define NATIVEFT DFNTF_BEIEEE
00293 #endif
00294 
00295 #if defined(__ARM__) || defined(__arm__)
00296 #if defined(__ARMEB__)
00297 #  define NATIVEIT DFNTI_MBO
00298 #  define NATIVEFT DFNTF_BEIEEE
00299 #endif
00300 #if defined(__ARMEL__)
00301 #  define NATIVEIT DFNTI_IBO
00302 #  define NATIVEFT DFNTF_LEIEEE
00303 #endif
00304 #endif
00305 
00306 #ifndef NATIVEFT
00307 #  error "Can't determine machine number format"
00308 #endif
00309 
00310 #define DFNT_UINT       0       
00311 #define DFNT_SINT       1       
00312 #define DFNT_INT        2       
00313 #define DFNT_UCHAR      3       
00314 #define DFNT_CHAR       4       
00315 #define DFNT_FLOAT      5       
00316 #define DFNT_DOUBLE     6       
00318 #endif
00319 
00320 #endif /* __CCP4_BITS */
00321 
00322 /*
00323   Local variables:
00324   mode: font-lock
00325   End:
00326 */