All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TerraLibPlatform.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/TerraLibPlatform.h
22 
23  \brief Global configuration flags for the TerraLib.
24 */
25 
26 #ifndef __TERRALIB_INTERNAL_TERRALIBPLATFORM_H
27 #define __TERRALIB_INTERNAL_TERRALIBPLATFORM_H
28 
29 /*!
30  \def TE_PLATFORMCODE_MSWINDOWS
31 
32  \brief Microsoft Windows platform code.
33  */
34 #define TE_PLATFORMCODE_MSWINDOWS 1
35 
36 /*!
37  \def TE_PLATFORMCODE_LINUX
38 
39  \brief Linux platform code.
40  */
41 #define TE_PLATFORMCODE_LINUX 2
42 
43 /*!
44  \def TE_PLATFORMCODE_SOLARIS
45 
46  \brief Solaris platform code.
47  */
48 #define TE_PLATFORMCODE_SOLARIS 3
49 
50 /*!
51  \def TE_PLATFORMCODE_SUNOS
52 
53  \brief Sun OS platform code.
54  */
55 #define TE_PLATFORMCODE_SUNOS 4
56 
57 /*!
58  \def TE_PLATFORMCODE_APPLE
59 
60  \brief Apple platform code.
61  */
62 #define TE_PLATFORMCODE_APPLE 5
63 
64 /*!
65  \def TE_PLATFORMCODE_AIX
66 
67  \brief IBM AIX platform code.
68  */
69 #define TE_PLATFORMCODE_AIX 6
70 
71 /*!
72  \def TE_PLATFORMCODE_FREEBSD
73 
74  \brief FreeBSD platform code.
75  */
76 #define TE_PLATFORMCODE_FREEBSD 7
77 
78 /*!
79  \def TE_PLATFORMCODE_OPENBSD
80 
81  \brief OpenBSD platform code.
82  */
83 #define TE_PLATFORMCODE_OPENBSD 8
84 
85 /*!
86  \def TE_PLATFORM
87 
88  \brief It keeps the code of the Operational System platform detected by the build system.
89  */
90 #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__) || defined(_WIN32_WCE)
91  #define TE_PLATFORM TE_PLATFORMCODE_MSWINDOWS
92 #elif defined(__LINUX__) || defined(linux) || defined(__linux__) || defined(__linux)
93  #define TE_PLATFORM TE_PLATFORMCODE_LINUX
94 #elif defined(sparc) || defined(sun) || defined(__sun)
95  #if defined(__SVR4) || defined(__svr4__)
96  #define TE_PLATFORM TE_PLATFORMCODE_SOLARIS
97  #else
98  #define TE_PLATFORM TE_PLATFORMCODE_SUNOS
99  #endif
100 #elif (defined(__APPLE__) && defined(__MACH__)) || defined(macintosh) || defined(Macintosh)
101  #define TE_PLATFORM TE_PLATFORMCODE_APPLE
102 #elif defined(_AIX) || defined(__TOS_AIX__)
103  #define TE_PLATFORM TE_PLATFORMCODE_AIX
104 #elif defined(__FreeBSD__)
105  #define TE_PLATFORM TE_PLATFORMCODE_FREEBSD
106 #elif defined(__OpenBSD__)
107  #define TE_PLATFORM TE_PLATFORMCODE_OPENBSD
108 #else
109  #error "ERROR: Unknown platform"
110 #endif
111 
112 //@}
113 
114 /** @name Compiler Platform Detection Macros
115  * Macros for detecting compiler platform.
116  */
117 //@{
118 
119 /*!
120  \def TE_COMPILERCODE_VCPLUSPLUS
121 
122  \brief MS Visual Studio C++.
123  */
124 #define TE_COMPILERCODE_VCPLUSPLUS 1
125 
126 /*!
127  \def TE_COMPILERCODE_BCPLUSPLUS
128 
129  \brief Borland C++.
130  */
131 #define TE_COMPILERCODE_BCPLUSPLUS 2
132 
133 /*!
134  \def TE_COMPILERCODE_GNUC
135 
136  \brief GNU Compiler.
137  */
138 #define TE_COMPILERCODE_GNUC 3
139 
140 /*!
141  \def TE_COMPILERCODE_CODEWARRIOR
142 
143  \brief CodeWarrior C++.
144  */
145 #define TE_COMPILERCODE_CODEWARRIOR 4
146 
147 /*!
148  \def TE_COMPILERCODE_SUNFORTE7
149 
150  \brief Sun Forte C++.
151  */
152 #define TE_COMPILERCODE_SUNFORTE7 5
153 
154 /*!
155  \def TE_COMPILERCODE_XLC
156 
157  \brief AIX xlC C++.
158  */
159 #define TE_COMPILERCODE_XLC 6
160 
161 /*!
162  \def TE_COMPILER
163 
164  \brief It keeps the code of the compiler detected by the build system.
165  */
166 #if defined( _MSC_VER )
167  #define TE_COMPILER TE_COMPILERCODE_VCPLUSPLUS
168 #elif defined( __BORLANDC__ ) || defined( __BCPLUSPLUS__ )
169  #define TE_COMPILER TE_COMPILERCODE_BCPLUSPLUS
170 #elif defined( __GNUC__ )
171  #define TE_COMPILER TE_COMPILERCODE_GNUC
172 #elif defined( __MWERKS__ )
173  #define TE_COMPILER TE_COMPILERCODE_CODEWARRIOR
174 #elif defined( __SUNPRO_CC)
175  #define TE_COMPILER TE_COMPILERCODE_SUNFORTE7
176 #elif defined( __xlC__ )
177  #define TE_COMPILER TE_COMPILERCODE_XLC
178 #else
179  #error "ERROR: Unknown compiler"
180 #endif
181 
182 //@}
183 
184 /** @name Architecture Detection Macros
185  * Macros for detecting machine architecture.
186  */
187 //@{
188 
189 //#define TE_32BIT_ARCH 32
190 
191 //#define TE_64BIT_ARCH 64
192 
193 //#if defined(_M_IA64) || defined(__ia64) || defined(_IA64) || defined(__amd64) || defined(_M_X64) || defined(__x86_64__)
194 // #define TE_XBIT_ARCH TE_64BIT_ARCH
195 //#else
196 // #define TE_XBIT_PLATFORM TE_32BIT_ARCH
197 //#endif
198 
199 //@}
200 
201 /*!
202  \def TE_XDR
203 
204  \brief Macro for big endian (machine byte order).
205  */
206 #define TE_XDR 0
207 
208 /*!
209  \def TE_NDR
210 
211  \brief Macro for little endian (machine byte order).
212  */
213 #define TE_NDR 1
214 
215 /*!
216  \def TE_MACHINE_BYTE_ORDER
217 
218  \brief This macro defines the machine byte order at build time.
219 
220  \note This macro must be set during the build system execution.
221  */
222 #ifndef TE_MACHINE_BYTE_ORDER
223 #define TE_MACHINE_BYTE_ORDER TE_NDR
224 #endif
225 
226 /** @name Platform Compatibility Declarations
227  * Macros for keeping type compatibility across platforms and compilers.
228  */
229 //@{
230 
231 /*!
232  \def TE_DOUBLE_NOT_A_NUMBER
233 
234  \brief Macro for defining not a number for float values.
235 
236  \todo Ver como tornar isso portavel!
237  */
238 #define TE_DOUBLE_NOT_A_NUMBER 1.7e-308
239 
240 //@}
241 
242 #endif // __TERRALIB_INTERNAL_TERRALIBPLATFORM_H
243