cartobase 6.0.6
zconfig.h
Go to the documentation of this file.
1/* This software and supporting documentation are distributed by
2 * Institut Federatif de Recherche 49
3 * CEA/NeuroSpin, Batiment 145,
4 * 91191 Gif-sur-Yvette cedex
5 * France
6 *
7 * This software is governed by the CeCILL-B license under
8 * French law and abiding by the rules of distribution of free software.
9 * You can use, modify and/or redistribute the software under the
10 * terms of the CeCILL-B license as circulated by CEA, CNRS
11 * and INRIA at the following URL "http://www.cecill.info".
12 *
13 * As a counterpart to the access to the source code and rights to copy,
14 * modify and redistribute granted by the license, users are provided only
15 * with a limited warranty and the software's author, the holder of the
16 * economic rights, and the successive licensors have only limited
17 * liability.
18 *
19 * In this respect, the user's attention is drawn to the risks associated
20 * with loading, using, modifying and/or developing or reproducing the
21 * software by the user in light of its specific status of free software,
22 * that may mean that it is complicated to manipulate, and that also
23 * therefore means that it is reserved for developers and experienced
24 * professionals having in-depth computer knowledge. Users are therefore
25 * encouraged to load and test the software's suitability as regards their
26 * requirements in conditions enabling the security of their systems and/or
27 * data to be ensured and, more generally, to use and operate it in the
28 * same conditions as regards security.
29 *
30 * The fact that you are presently reading this means that you have had
31 * knowledge of the CeCILL-B license and that you accept its terms.
32 */
33
34#ifndef __zconfigl__
35#define __zconfigl__ 1
36
37// Ensure our definitions have been set up
38#include "zconfigd.h"
39
40// ==================================================
41// Compiler
42
43#ifndef ZCONFIG_ResourceCompilerInvoked
44# if defined(mw_rez) || defined(RC_INVOKED) || defined(BE_RES_COMPILE)
45# define ZCONFIG_ResourceCompilerInvoked 1
46# else
47# define ZCONFIG_ResourceCompilerInvoked 0
48# endif
49#endif
50
51
52#if !ZCONFIG_ResourceCompilerInvoked
53# ifndef ZCONFIG_Compiler
54# if defined(__MWERKS__)
55# define ZCONFIG_Compiler ZCONFIG_Compiler_CodeWarrior
56# elif defined(__GNUC__)
57# define ZCONFIG_Compiler ZCONFIG_Compiler_GCC
58# elif defined(_MSC_VER)
59# define ZCONFIG_Compiler ZCONFIG_Compiler_MSVC
60# endif
61# endif
62# ifndef ZCONFIG_Compiler
63# error "Don't know what compiler we're using."
64# endif
65#endif
66
67// ==================================================
68// OS
69
70#if defined(RC_INVOKED)
71# define ZCONFIG_OS ZCONFIG_OS_Win32
72#elif defined(mw_rez)
73# define ZCONFIG_OS ZCONFIG_OS_MacOS7
74#elif defined(BE_RES_COMPILE)
75# define ZCONFIG_OS ZCONFIG_OS_Be
76#endif
77
78#if !ZCONFIG_ResourceCompilerInvoked
79# ifndef ZCONFIG_OS
80# if defined(__MWERKS__)
81# if TARGET_API_MAC_CARBON
82# define ZCONFIG_OS ZCONFIG_OS_Carbon
83# elif __MACOS__
84# define ZCONFIG_OS ZCONFIG_OS_MacOS7
85# elif __INTEL__
86# define ZCONFIG_OS ZCONFIG_OS_Win32
87# elif __BEOS__
88# define ZCONFIG_OS ZCONFIG_OS_Be
89# endif
90# elif defined(__GNUC__)
91# if defined(__unix__) || defined( __APPLE__ )
92# define ZCONFIG_OS ZCONFIG_OS_POSIX
93# elif __BEOS__
94# define ZCONFIG_OS ZCONFIG_OS_Be
95# endif
96# elif defined(_MSC_VER)
97# define ZCONFIG_OS ZCONFIG_OS_Win32
98# endif
99# endif
100# ifndef ZCONFIG_OS
101# error "Don't know what OS we're using."
102# endif
103#endif
104
105// ==================================================
106// Which variant of the STL
107
108#if !ZCONFIG_ResourceCompilerInvoked
109# ifndef ZCONFIG_STL
110# if defined(__MWERKS__)
111# define ZCONFIG_STL ZCONFIG_STL_Modena
112# else
113# define ZCONFIG_STL ZCONFIG_STL_Unknown
114# endif
115# endif
116#endif
117
118// ==================================================
119// Which processor?
120
121#if !ZCONFIG_ResourceCompilerInvoked
122# ifndef ZCONFIG_Processor
123# if defined(__MWERKS__)
124# if __POWERPC__
125# define ZCONFIG_Processor ZCONFIG_Processor_PPC
126# elif __MC68K__ || defined(mw_rez)
127# define ZCONFIG_Processor ZCONFIG_Processor_68K
128# elif __INTEL__ || defined(RC_INVOKED)
129# define ZCONFIG_Processor ZCONFIG_Processor_x86
130# endif
131# elif defined(__GNUC__)
132# if #cpu(i386)
133# define ZCONFIG_Processor ZCONFIG_Processor_x86
134# elif #cpu(sparc)
135# define ZCONFIG_Processor ZCONFIG_Processor_Sparc
136# elif #cpu(powerpc) || defined( __POWERPC__ )
137# define ZCONFIG_Processor ZCONFIG_Processor_PPC
138# endif
139# elif defined(_MSC_VER)
140# define ZCONFIG_Processor ZCONFIG_Processor_x86
141# endif
142# endif
143# ifndef ZCONFIG_Processor
144# error "Don't know what processor we're using."
145# endif
146#endif
147
148
149// ==================================================
150// Byte order
151
152#ifndef ZCONFIG_Endian
153# if !ZCONFIG_ResourceCompilerInvoked && !defined(ZCONFIG_Endian)
154# if (ZCONFIG_Processor == ZCONFIG_Processor_x86)
155# define ZCONFIG_Endian ZCONFIG_Endian_Little
156# else
157# define ZCONFIG_Endian ZCONFIG_Endian_Big
158# endif
159# endif
160#endif
161
162// ==================================================
163// We have two different defines for debugging. ZCONFIG_DebugLevel is what type of debugging
164// is wanted for a debug build (one with SYM information being generated). 0 generally means
165// almost no debug code will be generated, although it's legal to have assertions that are always
166// present in the code, even in a level 0 build.
167// Level 1 is for lighter weight debugging -- useful for code issued to external sites, code which has
168// had all the serious panic situations handled for heavily-executed code, but which may still have
169// lurking problems in less busy parts of the app. Level 2 is for development. Remember, these are
170// suggested values only, and the ZDebug suite of macros lets you determine whether we should panic
171// and kill the app, or just fprintf(stderr, ..) and go on our way.
172
173#ifndef ZCONFIG_DebugLevel
174# define ZCONFIG_DebugLevel 1
175#endif
176
177// ZCONFIG_Debug takes its value from ZCONFIG_DebugLevel if we're doing a SYM build, otherwise it
178// is set to 0. You can override ZCONFIG_Debug by setting its value in your zconfig.h before including this file.
179#ifndef ZCONFIG_Debug
180# if defined(__MWERKS__)
181# if __option(sym) && !ZCONFIG_ResourceCompilerInvoked
182# define ZCONFIG_Debug ZCONFIG_DebugLevel
183# else
184# define ZCONFIG_Debug 0
185# endif
186# else
187# if defined(DEBUG)
188# define ZCONFIG_Debug ZCONFIG_DebugLevel
189# else
190# define ZCONFIG_Debug 0
191# endif
192# endif
193#endif
194
195#ifndef ZCONFIG_Debug
196# error "Can't figure out if we're debugging."
197#endif
198
199// ==================================================
200// Which threads API?
201
202#if !ZCONFIG_ResourceCompilerInvoked
203# ifndef ZCONFIG_API_Thread
204# if ZCONFIG_OS_MacOS7 == ZCONFIG_OS
205# define ZCONFIG_API_Thread ZCONFIG_API_Thread_Mac
206# elif ZCONFIG_OS_Carbon == ZCONFIG_OS
207# define ZCONFIG_API_Thread ZCONFIG_API_Thread_Mac
208# elif ZCONFIG_OS_Win32 == ZCONFIG_OS
209# define ZCONFIG_API_Thread ZCONFIG_API_Thread_Win32
210# elif ZCONFIG_OS_POSIX == ZCONFIG_OS
211# define ZCONFIG_API_Thread ZCONFIG_API_Thread_POSIX
212# elif ZCONFIG_OS_Be == ZCONFIG_OS
213# define ZCONFIG_API_Thread ZCONFIG_API_Thread_Be
214# endif
215# endif
216# ifndef ZCONFIG_API_Thread
217# error "Don't know what thread API we're using"
218# endif
219#endif
220
221// Should we use the Thread Manager or deferred task mulit threading?
222#ifndef ZCONFIG_Fiber_ThreadManager
223# define ZCONFIG_Fiber_ThreadManager 1
224#endif
225
226// ==================================================
227// Which windowing API?
228
229#if !ZCONFIG_ResourceCompilerInvoked
230# ifndef ZCONFIG_API_OSWindow
231# if ZCONFIG_OS_MacOS7 == ZCONFIG_OS
232# define ZCONFIG_API_OSWindow ZCONFIG_API_OSWindow_Mac
233# elif ZCONFIG_OS_Carbon == ZCONFIG_OS
234# define ZCONFIG_API_OSWindow ZCONFIG_API_OSWindow_Mac
235# elif ZCONFIG_OS_Win32 == ZCONFIG_OS
236# define ZCONFIG_API_OSWindow ZCONFIG_API_OSWindow_Win32
237# elif ZCONFIG_OS_POSIX == ZCONFIG_OS
238# define ZCONFIG_API_OSWindow ZCONFIG_API_OSWindow_X
239# elif ZCONFIG_OS_Be == ZCONFIG_OS
240# define ZCONFIG_API_OSWindow ZCONFIG_API_OSWindow_Be
241# endif
242# endif
243#endif
244
245#ifndef ZCONFIG_API_OSWindow
246# define ZCONFIG_API_OSWindow ZCONFIG_API_Window_Unknown
247#endif
248
249// ==================================================
250// Which graphics API(s)?
251
252#if !ZCONFIG_ResourceCompilerInvoked
253# ifndef ZCONFIG_API_Graphics
254# if ZCONFIG_OS_MacOS7 == ZCONFIG_OS
255# define ZCONFIG_API_Graphics ZCONFIG_API_Graphics_QD
256# elif ZCONFIG_OS_Carbon == ZCONFIG_OS
257# define ZCONFIG_API_Graphics ZCONFIG_API_Graphics_QD
258# elif ZCONFIG_OS_Win32 == ZCONFIG_OS
259# define ZCONFIG_API_Graphics ZCONFIG_API_Graphics_GDI
260# elif ZCONFIG_OS_POSIX == ZCONFIG_OS
261# define ZCONFIG_API_Graphics ZCONFIG_API_Graphics_X
262# elif ZCONFIG_OS_Be == ZCONFIG_OS
263# define ZCONFIG_API_Graphics ZCONFIG_API_Graphics_Be
264# endif
265# endif
266#endif
267
268#ifndef ZCONFIG_API_Graphics
269# define ZCONFIG_API_Graphics ZCONFIG_API_Graphics_Unknown
270#endif
271
272// Set up a definition that will be true iff there is more than one graphics API active
273#define ZCONFIG_API_Graphics_Multi\
274 (\
275 ZCONFIG_API_Graphics_QD != ZCONFIG_API_Graphics &&\
276 ZCONFIG_API_Graphics_GDI != ZCONFIG_API_Graphics &&\
277 ZCONFIG_API_Graphics_X != ZCONFIG_API_Graphics &&\
278 ZCONFIG_API_Graphics_Be != ZCONFIG_API_Graphics &&\
279 ZCONFIG_API_Graphics_Generic != ZCONFIG_API_Graphics\
280 )
281
282// ==================================================
283// Which file system API?
284
285#if !ZCONFIG_ResourceCompilerInvoked
286# ifndef ZCONFIG_API_File
287# if ZCONFIG_OS_MacOS7 == ZCONFIG_OS
288# define ZCONFIG_API_File ZCONFIG_API_File_Mac
289# elif ZCONFIG_OS_Carbon == ZCONFIG_OS
290# define ZCONFIG_API_File ZCONFIG_API_File_Mac
291# elif ZCONFIG_OS_Win32 == ZCONFIG_OS
292# define ZCONFIG_API_File ZCONFIG_API_File_Win32
293# elif ZCONFIG_OS_POSIX == ZCONFIG_OS
294# define ZCONFIG_API_File ZCONFIG_API_File_POSIX
295# elif ZCONFIG_OS_Be == ZCONFIG_OS
296# define ZCONFIG_API_File ZCONFIG_API_File_Be
297# endif
298# endif
299#endif
300
301#ifndef ZCONFIG_API_File
302# define ZCONFIG_API_File ZCONFIG_API_File_Unknown
303#endif
304
305// ==================================================
306// Which network API(s)?
307
308#if !ZCONFIG_ResourceCompilerInvoked
309# ifndef ZCONFIG_API_Net
310# if ZCONFIG_OS_MacOS7 == ZCONFIG_OS
311# define ZCONFIG_API_Net ZCONFIG_API_Net_MacClassic
312# elif ZCONFIG_OS_Carbon == ZCONFIG_OS
313# define ZCONFIG_API_Net ZCONFIG_API_Net_MacOT
314# elif ZCONFIG_OS_Win32 == ZCONFIG_OS
315# define ZCONFIG_API_Net ZCONFIG_API_Net_WinSock
316# elif ZCONFIG_OS_POSIX == ZCONFIG_OS
317# define ZCONFIG_API_Net ZCONFIG_API_Net_Socket
318# elif ZCONFIG_OS_Be == ZCONFIG_OS
319# define ZCONFIG_API_Net ZCONFIG_API_Net_BeSocket
320# endif
321# endif
322#endif
323
324#ifndef ZCONFIG_API_Net
325# define ZCONFIG_API_Net ZCONFIG_API_Net_Unknown
326#endif
327
328// ==================================================
329// Declare namespace std and use it -- injecting all std names into global
330// namespace. A necessary hack until we've gone through all source and done this on
331// a case by case basis. This can be switched *off* by defining ZCONFIG_NamespaceHack
332// as zero in your zconfig.h file.
333
334#ifndef ZCONFIG_NamespaceHack
335# define ZCONFIG_NamespaceHack 0
336#endif
337
338#if ZCONFIG_NamespaceHack && defined(__cplusplus) && !ZCONFIG_ResourceCompilerInvoked
339 namespace std {}
340 using namespace std;
341#endif
342
343// ==================================================
344// Some extra bits to patch up some CodeWarrior issues.
345#if defined(__MWERKS__)
346# if __option(precompile)
347# error "Don't precompile zconfig -- settings on individual files will not match claimed configuration settings."
348# endif
349# ifndef NEWMODE
350# define NEWMODE NEWMODE_MALLOC
351# endif
352# if !ZCONFIG_Fiber_ThreadManager
353# if defined(_MWMT)
354# if _MWMT != 1
355# error "_MWMT must be 1 when not using Thread Manager -- check your headers to see who set it to zero."
356# endif
357# else
358# define _MWMT 1
359# endif
360# endif
361# define MSL_USE_PRECOMPILED_HEADERS 0
362#endif
363
364// ==================================================
365// Some extra bits to patch up some MSVC issues.
366#if defined(_MSC_VER)
367# if !defined(_MT)
368# error "_MT is not defined. ZooLib requires thread safe libraries and headers."
369# endif
370
371// Ghastly workaround for MSVC non compliance with C++ standard
372# define for if (0) {} else for
373
374// Disable illegal pragma warning -- we use pragma mark fairly extensively
375# pragma warning(disable:4068)
376
377// Disable debug info truncated to 255 characters (STL template expansion will often generate this)
378# pragma warning(disable:4786)
379
380#endif
381
382// ==================================================
383// Define _REENTRANT for all platforms, although it's only significant for POSIX.
384#ifndef _REENTRANT
385# define _REENTRANT
386#endif
387
388// ==================================================
389// A definition for 'nil', which is used extensively where NULL might more normally be expected.
390// The reason for this is that I was following the lead of Cyrus Ghalambor, who in turn used it (I think)
391// because a team he previously worked with had a fair number of ex-pascal people on it.
392#if 0 // denis 2005/12/09: disable this which conflicts with STL and libsigc++
393#ifndef nil
394# define nil (0)
395#endif
396#endif
397
398#endif // __zconfigl__
STL namespace.