1
/***************************************************************************
2
* Copyright (c) 2004 Jļæ½rgen Riegel <juergen.riegel@web.de> *
4
* This file is part of the FreeCAD CAx development system. *
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. *
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. *
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 *
21
***************************************************************************/
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.
35
//**************************************************************************
36
// switching the operating systems
39
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
43
#elif defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
50
#elif defined(__MWERKS__) && defined(__INTEL__)
54
#elif defined(linux) || defined(__linux) || defined(__linux__)
58
#elif defined(__CYGWIN__)
61
// Avoid conflicts with Inventor
65
# define HAVE_UINT16_T
67
# define HAVE_UINT32_T
69
# define HAVE_UINT64_T
70
# define HAVE_INTPTR_T
71
# define HAVE_UINTPTR_T
73
//#elif defined(sun) || defined(__sun) || defined(__sun__)
74
//# if defined(__SVR4)
75
//# define _FC_OS_SOLARIS
77
//# define _FC_OS_SUN_
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)
91
//#elif defined(__GNU__)
93
#elif defined(__APPLE__)
98
# error "FreeCAD is not ported to this OS yet. For help see free-cad.sourceforge.net"
102
# define PATHSEP '\\'
107
//**************************************************************************
108
// Standard types for Windows
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)
121
typedef unsigned char uint8_t;
126
typedef short int16_t;
129
#ifndef HAVE_UINT16_T
130
#define HAVE_UINT16_T
131
typedef unsigned short uint16_t;
139
#ifndef HAVE_UINT32_T
140
#define HAVE_UINT32_T
141
typedef unsigned int uint32_t;
146
typedef __int64 int64_t;
149
#ifndef HAVE_UINT64_T
150
#define HAVE_UINT64_T
151
typedef unsigned __int64 uint64_t;
156
//**************************************************************************
157
// Crt Memory debugging
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.
164
#if defined(_DEBUG) && defined(_MSC_VER)
165
//# define MemDebugOn
168
#if defined(MemDebugOn) && defined(FC_OS_WIN32)
169
# define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
171
# define DEBUG_CLIENTBLOCK new
176
//FIXME: Move to modules where OCC is needed
177
//**************************************************************************
195
//# define NO_CXX_EXCEPTION
200
/// enables the use of the OCC DocumentBrowser
202
# define FC_USE_OCAFBROWSER
218
//**************************************************************************
221
// Make sure to explicitly use the correct conversion
222
#define QT_NO_CAST_FROM_ASCII
224
#define QT_NO_KEYWORDS
226
#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN)
232
#ifndef QT_THREAD_SUPPORT
233
# define QT_THREAD_SUPPORT
236
#ifndef QT_ALTERNATE_QTSMANIP
237
# define QT_ALTERNATE_QTSMANIP
241
//**************************************************************************
243
#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN)
249
//**************************************************************************
251
#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN)
257
// stops inclusion of the QT 3 header through the SoQT header...
260
//**************************************************************************
261
// Exception handling
263
// Don't catch C++ exceptions in DEBUG!
265
# define DONT_CATCH_CXX_EXCEPTIONS 1
267
# define DBG_CATCH(X)
269
/// used to switch a catch with the debug state
270
# define DBG_TRY try {
272
# define DBG_CATCH(X) }catch(...) { X }
276
//**************************************************************************
277
// Windows import export DLL defines
278
#if defined (FC_OS_WIN32) || defined(FC_OS_CYGWIN)
280
# define AppExport __declspec(dllexport)
281
# define DataExport __declspec(dllexport)
283
# define AppExport __declspec(dllimport)
284
# define DataExport __declspec(dllimport)
287
# define BaseExport __declspec(dllexport)
289
# define BaseExport __declspec(dllimport)
292
# define GuiExport __declspec(dllexport)
294
# define GuiExport __declspec(dllimport)
312
//**************************************************************************
313
// here get the warnings of too long specifiers disabled (needed for VC6)
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