source: ntrip/branches/BNC_2.12/newmat/include.h@ 9269

Last change on this file since 9269 was 2013, checked in by mervart, 14 years ago

* empty log message *

File size: 7.6 KB
Line 
1/// \defgroup rbd_common RBD common library
2///@{
3
4/// \file include.h
5/// Set options and and details of include files.
6
7#ifndef INCLUDE_LIB
8#define INCLUDE_LIB
9
10//#define use_namespace // define name spaces
11
12#define SETUP_C_SUBSCRIPTS // allow element access via A[i][j]
13
14//#define OPT_COMPATIBLE // for use with opt++
15
16// Activate just one of the following 3 statements
17
18//#define SimulateExceptions // use simulated exceptions
19#define UseExceptions // use C++ exceptions
20//#define DisableExceptions // do not use exceptions
21
22
23//#define TEMPS_DESTROYED_QUICKLY // for compilers that delete
24 // temporaries too quickly
25
26//#define TEMPS_DESTROYED_QUICKLY_R // the same thing but applied
27 // to return from functions only
28
29//#define DO_FREE_CHECK // check news and deletes balance
30
31#define USING_DOUBLE // elements of type double
32//#define USING_FLOAT // elements of type float
33
34#define bool_LIB 0 // for compatibility with my older libraries
35
36//#define ios_format_flags ios::fmtflags // for Gnu 3 and Intel for Linux
37
38
39//#define _STANDARD_ // using standard library
40
41//#define use_float_h // use float.h for precision data
42
43
44//#define HAS_INT64 // if unsigned _int64 is recognised
45 // used by newran03
46
47// comment out next line if Exception causes a problem
48#define TypeDefException
49
50//*********************** end of options set by user ********************
51
52
53// for Gnu C++ version 3
54#if defined __GNUG__ && __GNUG__ >= 3
55 #define _STANDARD_ // use standard library
56 #define ios_format_flags ios::fmtflags
57#endif
58
59// for Intel C++ for Linux
60#if defined __ICC
61 #define _STANDARD_ // use standard library
62 #define ios_format_flags ios::fmtflags
63#endif
64
65// for Microsoft Visual C++ 7 and above (and Intel simulating these)
66#if defined _MSC_VER && _MSC_VER >= 1300
67 #define _STANDARD_ // use standard library
68#endif
69
70
71#ifdef _STANDARD_ // using standard library
72 #include <cstdlib>
73 #if defined _MSC_VER && _MSC_VER == 1200
74 #include <limits> // for VC++6
75 #endif
76 #ifdef WANT_STREAM
77 #include <iostream>
78 #include <iomanip>
79 #endif
80 #ifdef WANT_MATH
81 #include <cmath>
82 #endif
83 #ifdef WANT_STRING
84 #include <cstring>
85 #endif
86 #ifdef WANT_TIME
87 #include <ctime>
88 #endif
89 #ifdef WANT_FSTREAM
90 #include <fstream>
91 #endif
92 ////using namespace std;
93 #define USE_STD_NAMESPACE
94#else
95
96#define DEFAULT_HEADER // use AT&T style header
97 // if no other compiler is recognised
98
99#ifdef _MSC_VER // Microsoft
100 #include <stdlib.h>
101
102// reactivate these statements to run under MSC version 7.0
103// typedef int jmp_buf[9];
104// extern "C"
105// {
106// int __cdecl setjmp(jmp_buf);
107// void __cdecl longjmp(jmp_buf, int);
108// }
109
110 #ifdef WANT_STREAM
111 #include <iostream.h>
112 #include <iomanip.h>
113 #endif
114 #ifdef WANT_MATH
115 #include <math.h>
116 #include <float.h>
117 #endif
118 #ifdef WANT_STRING
119 #include <string.h>
120 #endif
121 #ifdef WANT_TIME
122 #include <time.h>
123 #endif
124 #ifdef WANT_FSTREAM
125 #include <fstream.h>
126 #endif
127 #undef DEFAULT_HEADER
128#endif
129
130#ifdef __ZTC__ // Zortech
131 #include <stdlib.h>
132 #ifdef WANT_STREAM
133 #include <iostream.hpp>
134 #include <iomanip.hpp>
135 #define flush "" // not defined in iomanip?
136 #endif
137 #ifdef WANT_MATH
138 #include <math.h>
139 #include <float.h>
140 #endif
141 #ifdef WANT_STRING
142 #include <string.h>
143 #endif
144 #ifdef WANT_TIME
145 #include <time.h>
146 #endif
147 #ifdef WANT_FSTREAM
148 #include <fstream.h>
149 #endif
150 #undef DEFAULT_HEADER
151#endif
152
153#if defined __BCPLUSPLUS__ || defined __TURBOC__ // Borland or Turbo
154 #include <stdlib.h>
155 #ifdef WANT_STREAM
156 #include <iostream.h>
157 #include <iomanip.h>
158 #endif
159 #ifdef WANT_MATH
160 #include <math.h>
161 #include <float.h> // Borland has both float and values
162 // but values.h returns +INF for
163 // MAXDOUBLE in BC5
164 #endif
165 #ifdef WANT_STRING
166 #include <string.h>
167 #endif
168 #ifdef WANT_TIME
169 #include <time.h>
170 #endif
171 #ifdef WANT_FSTREAM
172 #include <fstream.h>
173 #endif
174 #undef DEFAULT_HEADER
175#endif
176
177#ifdef __GNUG__ // Gnu C++
178 #include <stdlib.h>
179 #ifdef WANT_STREAM
180 #include <iostream.h>
181 #include <iomanip.h>
182 #endif
183 #ifdef WANT_MATH
184 #include <math.h>
185 #include <float.h>
186 #endif
187 #ifdef WANT_STRING
188 #include <string.h>
189 #endif
190 #ifdef WANT_TIME
191 #include <time.h>
192 #endif
193 #ifdef WANT_FSTREAM
194 #include <fstream.h>
195 #endif
196 #undef DEFAULT_HEADER
197#endif
198
199#ifdef __WATCOMC__ // Watcom C/C++
200 #include <stdlib.h>
201 #ifdef WANT_STREAM
202 #include <iostream.h>
203 #include <iomanip.h>
204 #endif
205 #ifdef WANT_MATH
206 #include <math.h>
207 #include <float.h>
208 #endif
209 #ifdef WANT_STRING
210 #include <string.h>
211 #endif
212 #ifdef WANT_TIME
213 #include <time.h>
214 #endif
215 #ifdef WANT_FSTREAM
216 #include <fstream.h>
217 #endif
218 #undef DEFAULT_HEADER
219#endif
220
221
222#ifdef macintosh // MPW C++ on the Mac
223#include <stdlib.h>
224#ifdef WANT_STREAM
225#include <iostream.h>
226#include <iomanip.h>
227#endif
228#ifdef WANT_MATH
229#include <float.h>
230#include <math.h>
231#endif
232#ifdef WANT_STRING
233#include <string.h>
234#endif
235#ifdef WANT_TIME
236#include <time.h>
237#endif
238#ifdef WANT_FSTREAM
239#include <fstream.h>
240#endif
241#undef DEFAULT_HEADER
242#endif
243
244#ifdef use_float_h // use float.h for precision values
245#include <stdlib.h>
246#ifdef WANT_STREAM
247#include <iostream.h>
248#include <iomanip.h>
249#endif
250#ifdef WANT_MATH
251#include <float.h>
252#include <math.h>
253#endif
254#ifdef WANT_STRING
255#include <string.h>
256#endif
257#ifdef WANT_TIME
258#include <time.h>
259#endif
260#ifdef WANT_FSTREAM
261#include <fstream.h>
262#endif
263#undef DEFAULT_HEADER
264#endif
265
266
267#ifdef DEFAULT_HEADER // for example AT&T
268#define ATandT
269#include <stdlib.h>
270#ifdef WANT_STREAM
271#include <iostream.h>
272#include <iomanip.h>
273#endif
274#ifdef WANT_MATH
275#include <math.h>
276#define SystemV // use System V
277#include <values.h>
278#endif
279#ifdef WANT_STRING
280#include <string.h>
281#endif
282#ifdef WANT_TIME
283#include <time.h>
284#endif
285#ifdef WANT_FSTREAM
286#include <fstream.h>
287#endif
288#endif // DEFAULT_HEADER
289
290#endif // _STANDARD_
291
292#ifdef use_namespace
293namespace RBD_COMMON {
294#endif
295
296
297#ifdef USING_FLOAT // set precision type to float
298typedef float Real;
299typedef double long_Real;
300#endif
301
302#ifdef USING_DOUBLE // set precision type to double
303typedef double Real;
304typedef long double long_Real;
305#endif
306
307
308// This is for (very old) compilers that do not have bool automatically defined
309
310#ifndef bool_LIB
311#define bool_LIB 0
312
313class bool
314{
315 int value;
316public:
317 bool(const int b) { value = b ? 1 : 0; }
318 bool(const void* b) { value = b ? 1 : 0; }
319 bool() {}
320 operator int() const { return value; }
321 int operator!() const { return !value; }
322};
323
324
325const bool true = 1;
326const bool false = 0;
327
328#endif
329
330
331#ifdef use_namespace
332}
333#endif
334
335
336#ifdef use_namespace
337namespace RBD_COMMON {}
338namespace RBD_LIBRARIES // access all my libraries
339{
340 using namespace RBD_COMMON;
341}
342#endif
343
344
345#endif
346
347
348///@}
349
Note: See TracBrowser for help on using the repository browser.