source: Sophya/trunk/SophyaLib/BaseTools/machdefs_mkmf.h@ 1870

Last change on this file since 1870 was 1870, checked in by ansari, 24 years ago

Adaptations pour compil avec g++ 3.0 - Reza 18/01/2002

File size: 9.4 KB
Line 
1#ifndef MACHDEFS_SEEN
2#define MACHDEFS_SEEN
3
4/***********************************************************************/
5/* Find hardware, OS and compiler combination */
6/***********************************************************************/
7
8#if defined(OSF1)
9#define MACH_ALPHA
10#define OS_OSF1
11#endif
12
13#if defined(_AIX) || defined(AIX)
14#define MACH_IBMRS
15#define OS_AIX
16#endif
17
18#if defined(__hpux__) || defined(HPUX)
19#define MACH_HP
20#define OS_HPUX
21#endif
22
23#ifdef __MWERKS__
24#define MACH_POWERMAC
25#define OS_MACOS
26#endif
27
28#if defined(SunOS) || defined ( sun )
29#define MACH_SUN
30#define OS_SOLARIS
31#endif
32
33#ifdef IRIX64
34#define MACH_SGI
35#define OS_IRIX64
36#endif
37
38#ifdef __APPLE__
39#ifdef __MACH__
40#define MACH_POWERPC
41#define OS_MACOSX
42#endif
43#endif
44
45#if defined(Linux) || defined(linux)
46#if defined(__alpha__)
47#define MACH_ALPHA
48#elif defined(powerpc)
49#define MACH_POWERPC
50#elif defined(__i386__)
51#define MACH_INTEL
52#else
53#error Undefined Platform (machine) type with linux in machdefs.h
54#endif
55#define OS_LINUX
56#endif
57
58
59/***********************************************************************/
60/* Hardware/OS dependent stuff */
61/***********************************************************************/
62
63#if defined(OS_OSF1)
64
65 typedef signed char int_1;
66 typedef unsigned char uint_1;
67 typedef int int_4;
68 typedef unsigned int uint_4;
69 typedef short int_2;
70 typedef unsigned short uint_2;
71 typedef float r_4;
72 typedef double r_8;
73 typedef long long int_8;
74 typedef unsigned long long uint_8;
75
76#define SWAP 1
77#define SWAPDEFAUT 1
78
79#elif defined(OS_HPUX)
80
81 typedef signed char int_1;
82 typedef unsigned char uint_1;
83 typedef int int_4 ;
84 typedef unsigned int uint_4;
85 typedef short int_2;
86 typedef unsigned short uint_2;
87 typedef float r_4;
88 typedef double r_8;
89 typedef long long int_8;
90 typedef unsigned long long uint_8;
91
92#define SWAP 0
93#define SWAPDEFAUT 0
94
95
96#elif defined( OS_AIX )
97
98 typedef signed char int_1;
99 typedef unsigned char uint_1;
100 typedef int int_4;
101 typedef unsigned int uint_4;
102 typedef short int_2;
103 typedef unsigned short uint_2;
104 typedef float r_4;
105 typedef double r_8;
106 typedef long long int_8;
107 typedef unsigned long long uint_8;
108
109#define SWAP 0
110#define SWAPDEFAUT 0
111
112/* Check for solaris on intel... */
113#elif defined( OS_SOLARIS ) && defined( MACH_SUN )
114
115 typedef signed char int_1;
116 typedef unsigned char uint_1;
117 typedef int int_4;
118 typedef unsigned int uint_4;
119 typedef short int_2;
120 typedef unsigned short uint_2;
121 typedef float r_4;
122 typedef double r_8;
123 typedef long long int_8;
124 typedef unsigned long long uint_8;
125
126#define SWAP 0
127#define SWAPDEFAUT 0
128
129#elif defined( OS_IRIX64 )
130
131 typedef signed char int_1;
132 typedef unsigned char uint_1;
133 typedef int int_4;
134 typedef unsigned int uint_4;
135 typedef short int_2;
136 typedef unsigned short uint_2;
137 typedef float r_4;
138 typedef double r_8;
139 typedef long long int_8;
140 typedef unsigned long long uint_8;
141
142#define SWAP 0
143#define SWAPDEFAUT 0
144
145/* Check linux on other machines than Intel */
146#elif defined(OS_LINUX)
147/* Sizes OK for PowerPC, Alpha, Intel */
148/* On Alpha, long is 8 bytes */
149 typedef signed char int_1;
150 typedef unsigned char uint_1;
151 typedef int int_4;
152 typedef unsigned int uint_4;
153 typedef short int_2;
154 typedef unsigned short uint_2;
155 typedef float r_4;
156 typedef double r_8;
157 typedef long long int_8;
158 typedef unsigned long long uint_8;
159
160#if defined(powerpc) || (__alpha__)
161#define SWAP 0
162#define SWAPDEFAUT 0
163#else
164#define SWAP 1
165#define SWAPDEFAUT 1
166#endif
167
168#elif defined(OS_MACOS)
169
170 typedef signed char int_1;
171 typedef unsigned char uint_1;
172 typedef long int_4;
173 typedef unsigned long uint_4;
174 typedef short int_2;
175 typedef unsigned short uint_2;
176 typedef float r_4;
177 typedef double r_8;
178 typedef long long int_8;
179 typedef unsigned long long uint_8;
180
181#define SWAP 0
182#define SWAPDEFAUT 0
183
184#elif defined(OS_MACOSX)
185
186 typedef signed char int_1;
187 typedef unsigned char uint_1;
188 typedef int int_4;
189 typedef unsigned int uint_4;
190 typedef short int_2;
191 typedef unsigned short uint_2;
192 typedef float r_4;
193 typedef double r_8;
194 typedef long long int_8;
195 typedef unsigned long long uint_8;
196
197#define SWAP 0
198#define SWAPDEFAUT 0
199
200
201#else
202#error Undefined Machine/OS type in machdefs.h
203#endif
204
205
206
207#if SWAP==1
208#define IS_BIG_ENDIAN 0
209#else
210#define IS_BIG_ENDIAN 1
211#endif
212
213
214/***********************************************************************/
215/* Find Compiler */
216/***********************************************************************/
217
218/* __MWERKS__ : Metrowerks Codewarrior (>= PRO 4) */
219/* __DECCXX : DEC CXX, version >= 6 is required */
220/* __GNUG__ : GNU C++ 2.8.1, egcs ?? */
221/* __aCC__ : aCC on HP */
222/* __KCC__ : KCC, version >= 3.3 is required */
223/* __SGICC__ : SGI (IRIX64) CC compiler */
224
225/***********************************************************************/
226/* Compiler-specific stuff */
227/***********************************************************************/
228
229/* Some features will be *required* for Planck. Which ones ? */
230
231/* ANSI_TEMPLATES : use ANSI syntax for explicit templates */
232/* GNUG_TEMPLATES : use GNU syntax for explicit templates */
233/* PRAGMA_TEMPLATES : use pragma template, a la cxx */
234/* COMPILER_EXCEPTIONS : knows about exceptions --- required ? */
235/* STREAMPOS_IS_CLASS : streampos is a real class */
236/* ITER_TAG : use iter_tag for iterator qualifiers in STL */
237/* NO_STRSTREAM : does not have strstream */
238/* HAS_EXPLICIT : knows about explicit keyword - constructors */
239/* HAS_IOS_BIN */
240/* HAS_IOS_NOCREATE */
241/* HAS_VEC_NEW : operator new[] */
242/* CC_HAS_RTTI_SUPPORT has Run Time Type Identification support */
243/* ANSI_IO : rdbuf()->pubseekoff rather than seekg */
244/* HAS_STR_NPOS : has string::npos and not a global NPOS */
245/* NO_IOS_COMPLEX : does not have operator << defined for complex */
246
247
248/* The following is true for most compilers */
249
250#ifndef HAS_VEC_NEW
251#define HAS_VEC_NEW
252#endif
253
254#ifndef COMPILER_EXCEPTIONS
255#define COMPILER_EXCEPTIONS
256#endif
257
258#ifndef CC_HAS_RTTI_SUPPORT
259#define CC_HAS_RTTI_SUPPORT
260#endif
261
262/* now the specific things */
263
264#ifdef __MWERKS__
265#define ANSI_TEMPLATES
266#undef HAS_VEC_NEW
267#define NO_STRSTREAM
268//#define STREAMPOS_IS_CLASS
269#define ITER_TAG
270#define HAS_IOS_BIN
271#define HAS_IOS_NOCREATE
272#define HAS_STR_NPOS
273#endif
274
275#ifdef __GNUG__
276#define ANSI_TEMPLATES
277// #define GNU_TEMPLATES
278#define HAS_STR_NPOS
279#define HAS_EXPLICIT
280#define HAS_IOS_BIN
281#define HAS_IOS_NOCREATE
282#endif
283
284#ifdef __DECCXX
285#define HAS_STR_NPOS
286#define ITER_TAG
287#define __CXX_PRAGMA_TEMPLATES__
288#define PRAGMA_TEMPLATES
289#endif
290
291#if defined (__aCC__)
292#ifndef ANSI_TEMPLATES
293#define ANSI_TEMPLATES
294#endif
295#endif
296
297#if defined(__KCC__)
298/* KCC V 3.2 ne compile pas i/ostream s ; long p = s.tellg(); OK en V 3.3 */
299#define HAS_STR_NPOS
300#ifndef ANSI_TEMPLATES
301#define ANSI_TEMPLATES
302#endif
303#endif
304
305#if defined(__SGICC__)
306#define HAS_STR_NPOS
307#ifndef ANSI_TEMPLATES
308#define ANSI_TEMPLATES
309#endif
310#endif
311
312/* Get things has homogeneous as possible between compilers */
313
314#ifdef HAS_STR_NPOS
315#define NPOS string::npos
316#else
317#define NPOS (size_t)-1
318#endif
319
320#ifndef __GNUG__
321#define __PRETTY_FUNCTION__ __FILE__ " __LINE__ "
322#ifndef __FUNCTION__
323#define __FUNCTION__ __FILE__ " __LINE__ "
324#endif
325#ifndef __KCC__
326#define __attribute__(_x_)
327#endif
328#endif
329
330#ifndef HAS_EXPLICIT
331#define explicit
332#endif
333
334#ifdef HAS_IOS_BIN
335#define IOS_BIN ios::binary
336#else
337#define IOS_BIN 0
338#endif
339
340#ifdef ANSI_IO
341#define seekg(p_, m_) rdbuf()->pubseekoff(p_,m_)
342#define seekp(p_, m_) rdbuf()->pubseekoff(p_,m_)
343#endif
344
345#ifdef __MWERKS__
346//#define hypot(_x_,_y_) sqrt((_x_)*(_x_) + (_y_)*(_y_))
347#define random() (rand()*65538.0 + rand()*2. + rand())
348#define srandom srand
349#define initstate(seed, tab, n) srand(seed)
350#define nice(_x)
351
352#ifdef __cplusplus
353#include <string.h>
354#include <string>
355inline bool operator< (string const& s1, string const& s2)
356{ return (strcmp(s1.c_str(), s2.c_str()) < 0); }
357#endif
358#endif
359
360#ifdef OS_MACOSX
361#define NO_VALUES_H
362#include "osx_values.h"
363/* Faute de mieux pour le moment : */
364#define drand48() ((double)(random())/LONG_MAX)
365#endif
366
367
368/********************************************************/
369/* Outil d'impressions pour debug */
370#define PR(_data_) {cout<<" "<<#_data_<<" "<<_data_;}
371#define CR {cout<<"\n"<<flush;}
372/* ********************************************************/
373
374/* ---- Activation des flags de debug/bound checking ----- */
375#ifdef SOPHYA_DEBUG
376#define SO_BOUNDCHECKING
377#endif
378
379/* ---- La taille et les index des tableaux ---- */
380#ifdef SGI_ARCH64
381typedef int_8 sa_size_t ;
382#else
383typedef int_4 sa_size_t ;
384#endif
385
386/* Compatibilite, avant de migrer tout le code en "PLANCK" */
387
388#ifdef __cplusplus
389/* Standard C++ library classes are in the namespace std */
390namespace std { }
391using namespace std;
392/* SOPHYA classes are in namespace SOPHYA */
393namespace SOPHYA {}
394using namespace SOPHYA;
395#define EXPLICIT explicit
396#endif
397
398#endif
Note: See TracBrowser for help on using the repository browser.