• Main Page
  • Related Pages
  • Classes
  • Files
  • File List
  • File Members

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

Generated on Mon Jan 10 2011 for gpp4 by  doxygen 1.7.1