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

Last change on this file since 2457 was 2339, checked in by ansari, 23 years ago

Compli avec SGI-CC -LANG:std et remplacement template <> pour SGI-CC par DECL_TEMP_SPEC - Reza 10/03/2003

File size: 9.7 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/* NO_EXPLICIT : does not know about explicit keyword */
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/* DECL_TEMP_SPEC : Template specialization declaration */
247
248
249/* (STREAMPOS_IS_CLASS non-active: ca compile sans sur gcc3.2 et cxx)
250 rz+cmv 11/02/03 */
251
252/* The following is true for most compilers */
253
254#ifndef HAS_VEC_NEW
255#define HAS_VEC_NEW
256#endif
257
258#ifndef COMPILER_EXCEPTIONS
259#define COMPILER_EXCEPTIONS
260#endif
261
262#ifndef CC_HAS_RTTI_SUPPORT
263#define CC_HAS_RTTI_SUPPORT
264#endif
265
266
267#ifndef DECL_TEMP_SPEC
268#define DECL_TEMP_SPEC
269#endif
270
271
272/* now the specific things */
273
274#ifdef __MWERKS__
275#define ANSI_TEMPLATES
276#undef HAS_VEC_NEW
277#define NO_STRSTREAM
278//#define STREAMPOS_IS_CLASS
279#define ITER_TAG
280#define HAS_IOS_BIN
281#define HAS_IOS_NOCREATE
282#define HAS_STR_NPOS
283#endif
284
285#ifdef __GNUG__
286#define ANSI_TEMPLATES
287/*
288if (__GNUC__ >= 3)
289define STREAMPOS_IS_CLASS
290endif
291*/
292#define GNU_TEMPLATES
293#define HAS_STR_NPOS
294#define HAS_IOS_BIN
295#define HAS_IOS_NOCREATE
296#endif
297
298#ifdef __DECCXX
299#define HAS_STR_NPOS
300#define ITER_TAG
301#define __CXX_PRAGMA_TEMPLATES__
302#define PRAGMA_TEMPLATES
303#endif
304
305#if defined (__aCC__)
306#ifndef ANSI_TEMPLATES
307#define ANSI_TEMPLATES
308#endif
309#endif
310
311#if defined(__KCC__)
312/* KCC V 3.2 ne compile pas i/ostream s ; long p = s.tellg(); OK en V 3.3 */
313#define HAS_STR_NPOS
314#ifndef ANSI_TEMPLATES
315#define ANSI_TEMPLATES
316#endif
317#endif
318
319#if defined(__SGICC__)
320#define HAS_STR_NPOS
321#ifndef ANSI_TEMPLATES
322#define ANSI_TEMPLATES
323#undef DECL_TEMP_SPEC
324#define DECL_TEMP_SPEC template <>
325#endif
326#endif
327
328/* Get things has homogeneous as possible between compilers */
329
330#ifdef HAS_STR_NPOS
331#define NPOS string::npos
332#else
333#define NPOS (size_t)-1
334#endif
335
336#ifndef __GNUG__
337#define __PRETTY_FUNCTION__ __FILE__ " __LINE__ "
338#ifndef __FUNCTION__
339#define __FUNCTION__ __FILE__ " __LINE__ "
340#endif
341#ifndef __KCC__
342#define __attribute__(_x_)
343#endif
344#endif
345
346#ifdef NO_EXPLICIT
347#define explicit
348#endif
349
350#ifdef HAS_IOS_BIN
351#define IOS_BIN ios::binary
352#else
353#define IOS_BIN 0
354#endif
355
356/* Commente par Reza+CMV - Fev 2003
357 ifdef ANSI_IO
358 define seekg(p_, m_) rdbuf()->pubseekoff(p_,m_)
359 define seekp(p_, m_) rdbuf()->pubseekoff(p_,m_)
360 endif
361*/
362
363#ifdef __MWERKS__
364//#define hypot(_x_,_y_) sqrt((_x_)*(_x_) + (_y_)*(_y_))
365#define random() (rand()*65538.0 + rand()*2. + rand())
366#define srandom srand
367#define initstate(seed, tab, n) srand(seed)
368#define nice(_x)
369
370#ifdef __cplusplus
371#include <string.h>
372#include <string>
373inline bool operator< (string const& s1, string const& s2)
374{ return (strcmp(s1.c_str(), s2.c_str()) < 0); }
375#endif
376#endif
377
378#ifdef OS_MACOSX
379#define NO_VALUES_H
380#include "osx_values.h"
381#endif
382
383
384/********************************************************/
385/* Outil d'impressions pour debug */
386#define PR(_data_) {cout<<" "<<#_data_<<" "<<_data_;}
387#define CR {cout<<"\n"<<flush;}
388/* ********************************************************/
389
390/* ---- Activation des flags de debug/bound checking ----- */
391#ifdef SOPHYA_DEBUG
392#define SO_BOUNDCHECKING
393#endif
394
395/* ---- La taille et les index des tableaux ---- */
396#ifdef SGI_ARCH64
397typedef int_8 sa_size_t ;
398#else
399typedef int_4 sa_size_t ;
400#endif
401
402/* Compatibilite, avant de migrer tout le code en "PLANCK" */
403
404#ifdef __cplusplus
405/* Standard C++ library classes are in the namespace std */
406namespace std { }
407using namespace std;
408/* SOPHYA classes are in namespace SOPHYA */
409namespace SOPHYA {}
410using namespace SOPHYA;
411#define EXPLICIT explicit
412#endif
413
414#endif
Note: See TracBrowser for help on using the repository browser.