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

Last change on this file since 3754 was 3750, checked in by ansari, 16 years ago

Prise en charge de float 128 bits (r_16, complex<r_16>) par les NDataBlock<T> et PPersist, controlee par le flag de compilation SO_LDBLE128 defini ds machdefs.h , Reza 03/03/2010

File size: 8.1 KB
Line 
1#ifndef MACHDEFS_SEEN
2#define MACHDEFS_SEEN
3
4/* -------------- List of flags (and description) -------------------
5 - SO_ARCH64 : select 64 bits architecture (default 32 bits)
6 - SO_NOFPIC : disable fPIC flag (Position Independent Code) default fPIC enabled
7 - SO_SASIZET64 : select 64 bits size for array indices (default 32 bits)
8 - SO_LDBLE128 : enable support for 128 bits floating point numbers (default NO 128 bits floats)
9 - SO_BOUNDCHECKING : activate bound checking (in accessing array elements)
10 - SOPHYA_DEBUG : debug flag ( --> if set, SO_BOUNDCHECKING is also set)
11 ------------------------------------------------------------------ */
12
13#ifdef SOPHYA_DEBUG
14#define SO_BOUNDCHECKING
15#endif
16
17/***********************************************************************/
18/* Find hardware, OS and compiler combination */
19/***********************************************************************/
20
21#if defined(OSF1)
22#define MACH_ALPHA
23#endif
24
25#if defined(_AIX) || defined(AIX)
26#define MACH_IBMRS
27#endif
28
29#if defined(__hpux__) || defined(HPUX)
30#define MACH_HP
31#endif
32
33#if defined(SunOS) || defined ( sun )
34#define MACH_SUN
35#endif
36
37#ifdef IRIX64
38#define MACH_SGI
39#endif
40
41#ifdef __APPLE__
42#ifdef __MACH__
43#ifdef __POWERPC__
44#define MACH_POWERPC
45#else
46#define MACH_INTEL
47#endif
48#endif
49#endif
50
51#if defined(Linux) || defined(linux)
52#if defined(__alpha__)
53#define MACH_ALPHA
54#elif defined(powerpc)
55#define MACH_POWERPC
56#elif defined(__i386__)
57#define MACH_INTEL
58#else
59#define MACH_AMD
60/* $CHECK$ (Reza Avril 2007): Il faut affiner ce test pour
61 determiner correctement le type de processeur */
62#endif
63#endif
64
65/***********************************************************************/
66/* Hardware/OS dependent stuff */
67/***********************************************************************/
68
69/* --------------------------------------------------------------- */
70/* 1/ typedefs for different size integers and floats */
71/* --------------------------------------------------------------- */
72
73/* --- Avr2007: The following typdefs should be OK for most system */
74/* and compilers: OSF, Linux, AIX, SGI, MacOSX, Sun, HP */
75
76typedef signed char int_1;
77typedef unsigned char uint_1;
78typedef short int_2;
79typedef unsigned short uint_2;
80typedef int int_4;
81typedef unsigned int uint_4;
82typedef long long int_8;
83typedef unsigned long long uint_8;
84typedef float r_4;
85typedef double r_8;
86#ifdef SO_LDBLE128
87/* 128 bits floating point numbers */
88typedef long double r_16;
89#endif
90
91/* --------------------------------------------------------------- */
92/* 2/ Endiannes (/ byteswap for different processors) */
93/* --------------------------------------------------------------- */
94/*
95 ==> POWERPC, IBMRS, HP_UX, IRIX64, SunSPARC (?) :
96 BigEndian ( SWAP=SWAPDEFAUT=0)
97 ==> ALPHA, INTEL, AMD :
98 LittleEndian ( SWAP=SWAPDEFAUT=1)
99*/
100
101#if defined(MACH_ALPHA) || defined(MACH_INTEL) || defined(MACH_AMD)
102#define IS_BIG_ENDIAN 0
103#else
104#define IS_BIG_ENDIAN 1
105#endif
106
107/* ---- La taille des index des tableaux ---- */
108#ifdef SO_SASIZET64
109typedef int_8 sa_size_t ;
110#else
111typedef int_4 sa_size_t ;
112#endif
113
114
115/***********************************************************************/
116/* Find Compiler */
117/***********************************************************************/
118
119/* __DECCXX : DEC CXX, version >= 6 is required */
120/* __GNUG__ : GNU C++ 2.8.1, egcs ?? */
121/* __aCC__ : aCC on HP */
122/* __KCC__ : KCC, version >= 3.3 is required */
123/* __SGICC__ : SGI (IRIX64) CC compiler */
124/* __INTEL_COMPILER : : INTEL compiler */
125/* __IBMCPP__ : AIX (IBM) xlC c++ compiler */
126
127/***********************************************************************/
128/* Compiler-specific stuff */
129/***********************************************************************/
130
131/* ANSI_TEMPLATES : use ANSI syntax for explicit templates */
132/* GNUG_TEMPLATES : use GNU syntax for explicit templates */
133/* PRAGMA_TEMPLATES : use pragma template, a la cxx */
134/* COMPILER_EXCEPTIONS : knows about exceptions --- required ? */
135/* STREAMPOS_IS_CLASS : streampos is a real class */
136/* ITER_TAG : use iter_tag for iterator qualifiers in STL */
137/* NO_STRSTREAM : does not have strstream */
138/* HAS_IOS_BIN */
139/* HAS_IOS_NOCREATE */
140/* HAS_VEC_NEW : operator new[] */
141/* CC_HAS_RTTI_SUPPORT has Run Time Type Identification support */
142/* ANSI_IO : rdbuf()->pubseekoff rather than seekg */
143/* HAS_STR_NPOS : has string::npos and not a global NPOS */
144/* NO_IOS_COMPLEX : does not have operator << defined for complex */
145/* DECL_TEMP_SPEC : Template specialization declaration */
146/* TSNMLUPG4 : Two stage name look-up scheme (g++>3.4) */
147
148
149/* (STREAMPOS_IS_CLASS non-active: ca compile sans sur gcc3.2 et cxx)
150 rz+cmv 11/02/03 */
151
152/* The following is true for most compilers */
153
154#ifndef HAS_VEC_NEW
155#define HAS_VEC_NEW
156#endif
157
158#ifndef COMPILER_EXCEPTIONS
159#define COMPILER_EXCEPTIONS
160#endif
161
162#ifndef CC_HAS_RTTI_SUPPORT
163#define CC_HAS_RTTI_SUPPORT
164#endif
165
166
167#ifndef DECL_TEMP_SPEC
168#define DECL_TEMP_SPEC
169#endif
170
171/* Most compilers dot not implement two level name lookup for templates
172 introduced by gcc >= 3.4
173*/
174#ifdef TSNMLUPG4
175#undef TSNMLUPG4
176#endif
177
178/* now the specific things */
179
180#ifdef __GNUC__
181#define GCC_VERSION (__GNUC__ * 1000 \
182 + __GNUC_MINOR__ * 100 \
183 + __GNUC_PATCHLEVEL__)
184#define ANSI_TEMPLATES
185/*
186if (__GNUC__ >= 3)
187define STREAMPOS_IS_CLASS
188endif
189*/
190#define GNU_TEMPLATES
191#define HAS_STR_NPOS
192#define HAS_IOS_BIN
193#define HAS_IOS_NOCREATE
194#if ( GCC_VERSION >= 3000 )
195#undef DECL_TEMP_SPEC
196#define DECL_TEMP_SPEC template <>
197#endif
198#if ( GCC_VERSION >= 3400 )
199/* Two level name look-up scheme for templates introduced from gcc 3.4 */
200#define TSNMLUPG4
201#endif
202
203#endif
204
205#ifdef __DECCXX
206#define HAS_STR_NPOS
207#define ITER_TAG
208#define __CXX_PRAGMA_TEMPLATES__
209#define PRAGMA_TEMPLATES
210#endif
211
212#if defined (__aCC__)
213#ifndef ANSI_TEMPLATES
214#define ANSI_TEMPLATES
215#endif
216#endif
217
218#if defined(__KCC__)
219/* KCC V 3.2 ne compile pas i/ostream s ; long p = s.tellg(); OK en V 3.3 */
220#define HAS_STR_NPOS
221#ifndef ANSI_TEMPLATES
222#define ANSI_TEMPLATES
223#endif
224#endif
225
226#if defined(__SGICC__)
227#define HAS_STR_NPOS
228#ifndef ANSI_TEMPLATES
229#define ANSI_TEMPLATES
230#endif
231#undef DECL_TEMP_SPEC
232#define DECL_TEMP_SPEC template <>
233#endif
234
235#if defined(__IBMCPP__)
236/* IBM xlC compiler support Added : dec 2005 */
237#ifndef ANSI_TEMPLATES
238#define ANSI_TEMPLATES
239#endif
240#undef DECL_TEMP_SPEC
241#define DECL_TEMP_SPEC template <>
242#endif
243
244/* Get things has homogeneous as possible between compilers */
245
246#ifdef HAS_STR_NPOS
247#define NPOS string::npos
248#else
249#define NPOS (size_t)-1
250#endif
251
252#ifndef __GNUG__
253#define __PRETTY_FUNCTION__ __FILE__ " __LINE__ "
254#ifndef __FUNCTION__
255#define __FUNCTION__ __FILE__ " __LINE__ "
256#endif
257#ifndef __KCC__
258#define __attribute__(_x_)
259#endif
260#endif
261
262
263#ifdef HAS_IOS_BIN
264#define IOS_BIN ios::binary
265#else
266#define IOS_BIN 0
267#endif
268
269
270#ifdef Darwin
271#define NO_VALUES_H
272#include "osx_values.h"
273#endif
274
275
276#ifdef __cplusplus
277/* Standard C++ library classes are in the namespace std */
278namespace std { }
279using namespace std;
280/*******************************************/
281/* SOPHYA classes are in namespace SOPHYA */
282/* namespace SOPHYA {} */
283/* using namespace SOPHYA; */
284/* Please use instead: sopnamsp.h */
285/*******************************************/
286#endif
287
288#endif
Note: See TracBrowser for help on using the repository browser.