~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/FCConfig.h

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-07-16 18:37:41 UTC
  • Revision ID: james.westby@ubuntu.com-20090716183741-oww9kcxqrk991i1n
Tags: upstream-0.8.2237
ImportĀ upstreamĀ versionĀ 0.8.2237

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (c) 2004 Jļæ½rgen Riegel <juergen.riegel@web.de>              *
 
3
 *                                                                         *
 
4
 *   This file is part of the FreeCAD CAx development system.              *
 
5
 *                                                                         *
 
6
 *   This library is free software; you can redistribute it and/or         *
 
7
 *   modify it under the terms of the GNU Library General Public           *
 
8
 *   License as published by the Free Software Foundation; either          *
 
9
 *   version 2 of the License, or (at your option) any later version.      *
 
10
 *                                                                         *
 
11
 *   This library  is distributed in the hope that it will be useful,      *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
 *   GNU Library General Public License for more details.                  *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU Library General Public     *
 
17
 *   License along with this library; see the file COPYING.LIB. If not,    *
 
18
 *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
 
19
 *   Suite 330, Boston, MA  02111-1307, USA                                *
 
20
 *                                                                         *
 
21
 ***************************************************************************/
 
22
/** \file FCConfig.h
 
23
 *  \brief Include all needed defines and macros
 
24
 *  Here all defines and macro switching is done for FreeCAD.
 
25
 *  Every used library has its own section to define the configuration.
 
26
 *  This file keeps the makefiles and project files cleaner.
 
27
 */
 
28
 
 
29
 
 
30
#ifndef FC_CONFIG_H
 
31
#define FC_CONFIG_H
 
32
 
 
33
 
 
34
 
 
35
//**************************************************************************
 
36
// switching the operating systems
 
37
 
 
38
 
 
39
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
 
40
#       ifndef FC_OS_WIN32
 
41
#       define FC_OS_WIN32
 
42
#       endif
 
43
#elif defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
 
44
#       ifndef FC_OS_WIN32
 
45
#       define FC_OS_WIN32
 
46
#       endif
 
47
#       ifndef FC_OS_WIN64
 
48
#       define FC_OS_WIN64
 
49
#       endif
 
50
#elif defined(__MWERKS__) && defined(__INTEL__)
 
51
#       ifndef FC_OS_WIN32
 
52
#       define FC_OS_WIN32
 
53
#       endif
 
54
#elif defined(linux) || defined(__linux) || defined(__linux__)
 
55
#       ifndef FC_OS_LINUX
 
56
#       define FC_OS_LINUX
 
57
#       endif
 
58
#elif defined(__CYGWIN__)
 
59
#       ifndef FC_OS_CYGWIN
 
60
#       define FC_OS_CYGWIN
 
61
// Avoid conflicts with Inventor
 
62
#       define HAVE_INT8_T
 
63
#       define HAVE_UINT8_T
 
64
#       define HAVE_INT16_T
 
65
#       define HAVE_UINT16_T
 
66
#       define HAVE_INT32_T
 
67
#       define HAVE_UINT32_T
 
68
#       define HAVE_INT64_T
 
69
#       define HAVE_UINT64_T
 
70
#       define HAVE_INTPTR_T
 
71
#       define HAVE_UINTPTR_T
 
72
#       endif
 
73
//#elif defined(sun) || defined(__sun) || defined(__sun__)
 
74
//#     if defined(__SVR4)
 
75
//#             define _FC_OS_SOLARIS
 
76
//#     else
 
77
//#             define _FC_OS_SUN_
 
78
//#     endif
 
79
//#elif defined(hpux) || defined(__hpux) || defined(__hpux__)
 
80
//#     define FC_OS_HPUX_
 
81
//#elif defined(__FreeBSD__)
 
82
//#     define FC_OS_FREEBSD
 
83
//#elif defined(__NetBSD__)
 
84
//#     define FC_OS_NETBSD
 
85
//#elif defined(__OpenBSD__)
 
86
//#     define FC_OS_OPENBSD
 
87
//#elif defined(sgi) || defined(__sgi)
 
88
//#     define FC_OS_IRIX
 
89
//#elif defined(_AIX)
 
90
//#     define FC_OS_AIX
 
91
//#elif defined(__GNU__)
 
92
//#     define FC_OS_GNU
 
93
#elif defined(__APPLE__)
 
94
#       ifndef FC_OS_MACOSX
 
95
#       define FC_OS_MACOSX
 
96
#       endif
 
97
#else
 
98
#       error "FreeCAD is not ported to this OS yet. For help see free-cad.sourceforge.net"
 
99
#endif
 
100
 
 
101
#ifdef FC_OS_WIN32
 
102
#       define PATHSEP '\\'
 
103
#else
 
104
#       define PATHSEP '/'
 
105
#endif
 
106
 
 
107
//**************************************************************************
 
108
// Standard types for Windows
 
109
 
 
110
#if defined (FC_OS_WIN64)
 
111
#error "The standard types must be defined for the Windows 64 bit platform"
 
112
#elif defined (FC_OS_WIN32)
 
113
 
 
114
#ifndef HAVE_INT8_T
 
115
#define HAVE_INT8_T
 
116
typedef char                int8_t;
 
117
#endif
 
118
 
 
119
#ifndef HAVE_UINT8_T
 
120
#define HAVE_UINT8_T
 
121
typedef unsigned char       uint8_t;
 
122
#endif
 
123
 
 
124
#ifndef HAVE_INT16_T
 
125
#define HAVE_INT16_T
 
126
typedef short               int16_t;
 
127
#endif
 
128
 
 
129
#ifndef HAVE_UINT16_T
 
130
#define HAVE_UINT16_T
 
131
typedef unsigned short      uint16_t;
 
132
#endif
 
133
 
 
134
#ifndef HAVE_INT32_T
 
135
#define HAVE_INT32_T
 
136
typedef int                 int32_t;
 
137
#endif
 
138
 
 
139
#ifndef HAVE_UINT32_T
 
140
#define HAVE_UINT32_T
 
141
typedef unsigned int        uint32_t;
 
142
#endif
 
143
 
 
144
#ifndef HAVE_INT64_T
 
145
#define HAVE_INT64_T
 
146
typedef __int64             int64_t;
 
147
#endif
 
148
 
 
149
#ifndef HAVE_UINT64_T
 
150
#define HAVE_UINT64_T
 
151
typedef unsigned __int64    uint64_t;
 
152
#endif
 
153
 
 
154
#endif
 
155
 
 
156
//**************************************************************************
 
157
// Crt Memory debugging
 
158
 
 
159
/** Memory Crt debugging on
 
160
  * This switches the debug CRT on Windows on. This is mostly located in
 
161
  * MemDebug.cpp and .h in src/Base. With this on a file (MemLog.txt) is 
 
162
  * written on exit which reports e.g. unfreed memory.
 
163
  */
 
164
#if defined(_DEBUG) && defined(_MSC_VER)
 
165
//# define MemDebugOn
 
166
#endif
 
167
 
 
168
#if defined(MemDebugOn) && defined(FC_OS_WIN32)
 
169
# define DEBUG_CLIENTBLOCK   new( _CLIENT_BLOCK, __FILE__, __LINE__)
 
170
#else
 
171
# define DEBUG_CLIENTBLOCK   new
 
172
#endif // MemDebugOn
 
173
 
 
174
 
 
175
 
 
176
//FIXME: Move to modules where OCC is needed
 
177
//**************************************************************************
 
178
// Open CasCade
 
179
 
 
180
#ifdef FC_OS_WIN32
 
181
#       ifndef WNT
 
182
#       define WNT
 
183
#       endif
 
184
#       ifndef WIN32
 
185
#       define WIN32
 
186
#       endif
 
187
#       ifndef _WINDOWS
 
188
#       define _WINDOWS
 
189
#       endif
 
190
#endif
 
191
 
 
192
#ifdef FC_OS_LINUX
 
193
#       define LIN
 
194
#       define LININTEL
 
195
//#       define NO_CXX_EXCEPTION
 
196
#endif
 
197
 
 
198
#define CSFDB
 
199
 
 
200
/// enables the use of the OCC DocumentBrowser
 
201
#ifndef FC_OS_LINUX
 
202
#       define FC_USE_OCAFBROWSER
 
203
#endif
 
204
 
 
205
 
 
206
#ifdef FC_OCC_DEBUG
 
207
#       ifdef FC_DEBUG
 
208
#               define DEBUG 1
 
209
#       else
 
210
#               undef  DEBUG
 
211
#       ifndef NDEBUG
 
212
#               define NDEBUG
 
213
#       endif
 
214
#       endif
 
215
#endif
 
216
 
 
217
 
 
218
//**************************************************************************
 
219
// Qt
 
220
 
 
221
// Make sure to explicitly use the correct conversion
 
222
#define QT_NO_CAST_FROM_ASCII
 
223
#undef  QT3_SUPPORT
 
224
#define QT_NO_KEYWORDS
 
225
 
 
226
#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN)
 
227
# ifndef QT_DLL
 
228
#  define QT_DLL
 
229
# endif
 
230
#endif
 
231
 
 
232
#ifndef QT_THREAD_SUPPORT
 
233
# define QT_THREAD_SUPPORT
 
234
#endif
 
235
 
 
236
#ifndef QT_ALTERNATE_QTSMANIP
 
237
# define QT_ALTERNATE_QTSMANIP
 
238
#endif
 
239
 
 
240
 
 
241
//**************************************************************************
 
242
// Coin3D
 
243
#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN)
 
244
# ifndef COIN_DLL
 
245
#        define COIN_DLL
 
246
# endif
 
247
#endif
 
248
 
 
249
//**************************************************************************
 
250
// SoQt
 
251
#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN)
 
252
# ifndef SOQT_DLL
 
253
#   define SOQT_DLL
 
254
# endif
 
255
#endif
 
256
 
 
257
// stops inclusion of the QT 3 header through the SoQT header...
 
258
//#define __Qt3All__
 
259
 
 
260
//**************************************************************************
 
261
// Exception handling
 
262
 
 
263
// Don't catch C++ exceptions in DEBUG!
 
264
#ifdef FC_DEBUG
 
265
# define DONT_CATCH_CXX_EXCEPTIONS 1
 
266
#       define DBG_TRY
 
267
#       define DBG_CATCH(X)  
 
268
#else
 
269
/// used to switch a catch with the debug state
 
270
#       define DBG_TRY try      {
 
271
/// see docu DBGTRY
 
272
#       define DBG_CATCH(X) }catch(...) { X }
 
273
#endif
 
274
 
 
275
 
 
276
//**************************************************************************
 
277
// Windows import export DLL defines
 
278
#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN)
 
279
#       ifdef FCApp
 
280
#               define AppExport   __declspec(dllexport)
 
281
#               define DataExport  __declspec(dllexport)
 
282
#       else
 
283
#               define AppExport   __declspec(dllimport)
 
284
#               define DataExport  __declspec(dllimport)
 
285
#       endif
 
286
#       ifdef FCBase
 
287
#               define BaseExport  __declspec(dllexport)
 
288
#       else
 
289
#               define BaseExport  __declspec(dllimport)
 
290
#       endif
 
291
#       ifdef FCGui
 
292
#               define GuiExport   __declspec(dllexport)
 
293
#       else
 
294
#               define GuiExport   __declspec(dllimport)
 
295
#       endif
 
296
#else
 
297
#       ifndef BaseExport
 
298
#               define BaseExport
 
299
#       endif
 
300
#       ifndef GuiExport
 
301
#               define GuiExport
 
302
#       endif
 
303
#       ifndef AppExport
 
304
#               define AppExport
 
305
#       endif
 
306
#       ifndef DataExport
 
307
#               define DataExport
 
308
#       endif
 
309
#endif
 
310
 
 
311
 
 
312
//**************************************************************************
 
313
// here get the warnings of too long specifiers disabled (needed for VC6)
 
314
#ifdef _MSC_VER
 
315
#       pragma warning( disable : 4251 )
 
316
#       pragma warning( disable : 4503 )
 
317
#       pragma warning( disable : 4786 )  // specifier longer then 255 chars
 
318
#       pragma warning( disable : 4290 )  // not implemented throw specification
 
319
#       pragma warning( disable : 4996 )  // supress depricated warning for e.g. open()...
 
320
#       define _PreComp_                  // use precompiled header
 
321
#endif
 
322
 
 
323
 
 
324
#endif //FC_CONFIG_H