00001
00010 #ifndef __IND_TYPES__
00011 #define __IND_TYPES__
00012
00013 #include <limits.h>
00014 #include <float.h>
00015
00016
00017
00018
00019
00020 #ifndef True
00021 #define True 1
00022 #endif
00023 #ifndef False
00024 #define False 0
00025 #endif
00026
00027 #ifndef Uninitialized
00028 #define Uninitialized -1
00029 #endif
00030 #ifndef NO_ERROR
00031 #define NO_ERROR 0
00032 #endif
00033
00034 #ifndef MIN
00035 #define MIN(x,y) (((x) < (y)) ? (x) : (y))
00036 #endif
00037 #ifndef MAX
00038 #define MAX(x,y) (((x) > (y)) ? (x) : (y))
00039 #endif
00040
00041 #ifndef INT_MAX
00042 #error "Warning: INT_MAX undefined; default used"
00043 #define INT_MAX 2147483647
00044 #endif
00045
00046 #ifndef INT_MIN
00047 #error "Warning: INT_MIN undefined; default used"
00048 #define INT_MIN -2147483647
00049 #endif
00050
00051
00052
00053
00054
00055
00056
00062 #ifdef __cplusplus
00063 #define EXTERNAL_C_LINKAGE extern "C"
00064 #else
00065 #define EXTERNAL_C_LINKAGE
00066 #endif
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 #if defined(_CRAYMPP)
00077 typedef char i8;
00078 typedef short i32;
00079 typedef int i64;
00080 typedef float f32;
00081 typedef double f64;
00082 #define NO_I16
00083
00084
00085
00086
00087
00088
00089 #elif (defined(__GNUC__) && !defined(ANSI_COMPATIBLE))
00090 typedef char i8;
00091 typedef short i16;
00092 typedef long i32;
00093 #ifndef LONG_LONG_UNAVAILABLE
00094 typedef long long i64;
00095 #endif
00096 typedef float f32;
00097 typedef double f64;
00098
00099
00100 #else
00101 typedef char i8;
00102 typedef short i16;
00103 typedef long i32;
00104 typedef float f32;
00105 typedef double f64;
00106 #define NO_I64
00107
00108 #endif
00109
00110
00111
00112
00113
00114
00115
00116 #ifdef ANSI_COMPATIBLE
00117 #define NO_RINT_AVAILABLE
00118 #define NO_TEMPNAM_AVAIL
00119 #define NO_SNPRINTF_AVAIL
00120 #define NO_STRNCASECMP_AVAIL
00121 #define NO_HYPOT_AVAIL
00122 #define NO_SRAND48_AVAIL
00123 #define NO_DRAND48_AVAIL
00124 #define NO_ASSERT_FUNC_INFO_AVAIL
00125 #define NO_SIGNAL_HANDLING
00126 #define LONG_LONG_UNAVAILABLE
00127 #define LONG_DOUBLE_UNAVAILABLE
00128 #endif
00129
00130 #ifndef ROUND
00131 #define ROUND(a) (floor((0.5+(a))))
00132 #endif
00133
00134 #ifdef NO_TEMPNAM_AVAIL
00135 EXTERNAL_C_LINKAGE char *tempnam(const char *dir, const char *pfx);
00136 #endif
00137
00138 #ifdef NO_SNPRINTF_AVAIL
00139 EXTERNAL_C_LINKAGE int snprintf( char *str, size_t n, const char *format, ...);
00140 #endif
00141
00142 #ifdef NO_STRNCASECMP_AVAIL
00143 EXTERNAL_C_LINKAGE int strncasecmp(const char *str1, const char *str2, size_t n);
00144 #endif
00145
00146 #ifdef NO_HYPOT_AVAIL
00147 EXTERNAL_C_LINKAGE double hypot(double x, double y);
00148 #endif
00149
00150 #ifdef NO_SRAND48_AVAIL
00151 EXTERNAL_C_LINKAGE void srand48(long int seedval);
00152 #endif
00153
00154 #ifdef NO_DRAND48_AVAIL
00155 EXTERNAL_C_LINKAGE double drand48(void);
00156 #endif
00157
00158 #ifndef M_E
00159 #define M_E 2.7182818284590452354
00160 #endif
00161 #ifndef M_PI
00162 #define M_PI 3.14159265358979323846
00163 #endif
00164 #ifndef M_PI_2
00165 #define M_PI_2 1.57079632679489661923
00166 #endif
00167 #ifndef M_PI_4
00168 #define M_PI_4 0.78539816339744830962
00169 #endif
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189 int check_ind_types( int warn_if_missing );
00190 int endianness( void );
00191
00192 #define swap_endian_proto(type) type type ## _swap_endian(type num)
00193 swap_endian_proto(i32);
00194
00195 #ifndef NO_I64
00196 swap_endian_proto(i64);
00197
00198 #endif
00199
00200 #endif
00201