The BIG graph update
[rrdtool.git] / libraries / freetype-2.0.5 / include / freetype / config / ftconfig.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftconfig.h                                                             */
4 /*                                                                         */
5 /*    ANSI-specific configuration file (specification only).               */
6 /*                                                                         */
7 /*  Copyright 1996-2001 by                                                 */
8 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
9 /*                                                                         */
10 /*  This file is part of the FreeType project, and may only be used,       */
11 /*  modified, and distributed under the terms of the FreeType project      */
12 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
13 /*  this file you indicate that you have read the license and              */
14 /*  understand and accept it fully.                                        */
15 /*                                                                         */
16 /***************************************************************************/
17
18
19   /*************************************************************************/
20   /*                                                                       */
21   /* This header file contains a number of macro definitions that are used */
22   /* by the rest of the engine.  Most of the macros here are automatically */
23   /* determined at compile time, and you should not need to change it to   */
24   /* port FreeType, except to compile the library with a non-ANSI          */
25   /* compiler.                                                             */
26   /*                                                                       */
27   /* Note however that if some specific modifications are needed, we       */
28   /* advise you to place a modified copy in your build directory.          */
29   /*                                                                       */
30   /* The build directory is usually `freetype/builds/<system>', and        */
31   /* contains system-specific files that are always included first when    */
32   /* building the library.                                                 */
33   /*                                                                       */
34   /* This ANSI version should stay in `include/freetype/config'.           */
35   /*                                                                       */
36   /*************************************************************************/
37
38
39 #ifndef __FTCONFIG_H__
40 #define __FTCONFIG_H__
41
42 #include <ft2build.h>
43 #include FT_CONFIG_OPTIONS_H
44
45
46 FT_BEGIN_HEADER
47
48
49   /*************************************************************************/
50   /*                                                                       */
51   /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */
52   /*                                                                       */
53   /* These macros can be toggled to suit a specific system.  The current   */
54   /* ones are defaults used to compile FreeType in an ANSI C environment   */
55   /* (16bit compilers are also supported).  Copy this file to your own     */
56   /* `freetype/builds/<system>' directory, and edit it to port the engine. */
57   /*                                                                       */
58   /*************************************************************************/
59
60
61   /* We use <limits.h> values to know the sizes of the types.  */
62 #include <limits.h>
63
64   /* The number of bytes in an `int' type.  */
65 #if   UINT_MAX == 0xFFFFFFFFUL
66 #define FT_SIZEOF_INT  4
67 #elif UINT_MAX == 0xFFFFU
68 #define FT_SIZEOF_INT  2
69 #elif UINT_MAX > 0xFFFFFFFFU && UINT_MAX == 0xFFFFFFFFFFFFFFFFU
70 #define FT_SIZEOF_INT  8
71 #else
72 #error "Unsupported number of bytes in `int' type!"
73 #endif
74
75   /* The number of bytes in a `long' type.  */
76 #if   ULONG_MAX == 0xFFFFFFFFUL
77 #define FT_SIZEOF_LONG  4
78 #elif ULONG_MAX > 0xFFFFFFFFU && ULONG_MAX == 0xFFFFFFFFFFFFFFFFU
79 #define FT_SIZEOF_LONG  8
80 #else
81 #error "Unsupported number of bytes in `long' type!"
82 #endif
83
84
85   /* Preferred alignment of data */
86 #define FT_ALIGNMENT  8
87
88
89   /* UNUSED is a macro used to indicate that a given parameter is not used */
90   /* -- this is only used to get rid of unpleasant compiler warnings       */
91 #ifndef FT_UNUSED
92 #define FT_UNUSED( arg )  ( (arg) = (arg) )
93 #endif
94
95
96   /*************************************************************************/
97   /*                                                                       */
98   /*                     AUTOMATIC CONFIGURATION MACROS                    */
99   /*                                                                       */
100   /* These macros are computed from the ones defined above.  Don't touch   */
101   /* their definition, unless you know precisely what you are doing.  No   */
102   /* porter should need to mess with them.                                 */
103   /*                                                                       */
104   /*************************************************************************/
105
106
107   /*************************************************************************/
108   /*                                                                       */
109   /* IntN types                                                            */
110   /*                                                                       */
111   /*   Used to guarantee the size of some specific integers.               */
112   /*                                                                       */
113   typedef signed short    FT_Int16;
114   typedef unsigned short  FT_UInt16;
115
116 #if FT_SIZEOF_INT == 4
117
118   typedef signed int      FT_Int32;
119   typedef unsigned int    FT_UInt32;
120
121 #elif FT_SIZEOF_LONG == 4
122
123   typedef signed long     FT_Int32;
124   typedef unsigned long   FT_UInt32;
125
126 #else
127 #error "no 32bit type found -- please check your configuration files"
128 #endif
129
130   /* now, lookup for an integer type that is at least 32 bits */
131 #if FT_SIZEOF_INT >= 4
132
133   typedef int           FT_Fast;
134   typedef unsigned int  FT_UFast;
135
136 #elif FT_SIZEOF_LONG >= 4
137
138   typedef long          FT_Fast;
139   typedef unsigned long FT_UFast;
140
141 #endif
142
143
144
145   /* determine whether we have a 64-bit int type for platforms without */
146   /* Autoconf                                                          */
147 #if FT_SIZEOF_LONG == 8
148
149   /* FT_LONG64 must be defined if a 64-bit type is available */
150 #define FT_LONG64
151 #define FT_INT64  long
152
153 #elif defined( _MSC_VER )      /* Visual C++ (and Intel C++) */
154
155   /* this compiler provides the __int64 type */
156 #define FT_LONG64
157 #define FT_INT64  __int64
158
159 #elif defined( __BORLANDC__ )  /* Borland C++ */
160
161   /* XXXX: We should probably check the value of __BORLANDC__ in order */
162   /*       to test the compiler version.                               */
163
164   /* this compiler provides the __int64 type */
165 #define FT_LONG64
166 #define FT_INT64  __int64
167
168 #elif defined( __WATCOMC__ )   /* Watcom C++ */
169
170   /* Watcom doesn't provide 64-bit data types */
171
172 #elif defined( __MWKS__ )      /* Metrowerks CodeWarrior */
173
174   /* I don't know if it provides 64-bit data types, any suggestion */
175   /* is welcome.                                                   */
176
177 #elif defined( __GNUC__ )
178
179   /* GCC provides the "long long" type */
180 #define FT_LONG64
181 #define FT_INT64  long long int
182
183 #endif /* !FT_LONG64 */
184
185
186   /*************************************************************************/
187   /*                                                                       */
188   /* A 64-bit data type will create compilation problems if you compile    */
189   /* in strict ANSI mode.  To avoid them, we disable their use if          */
190   /* __STDC__ is defined.  You can however ignore this rule by             */
191   /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.        */
192   /*                                                                       */
193 #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
194
195 #ifdef __STDC__
196
197   /* undefine the 64-bit macros in strict ANSI compilation mode */
198 #undef FT_LONG64
199 #undef FT_INT64
200
201 #endif /* __STDC__ */
202
203 #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
204
205
206 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
207
208 #define FT_LOCAL      static
209 #define FT_LOCAL_DEF  static
210
211 #else
212
213 #ifdef __cplusplus
214 #define FT_LOCAL      extern "C"
215 #define FT_LOCAL_DEF  extern "C"
216 #else
217 #define FT_LOCAL      extern
218 #define FT_LOCAL_DEF  extern
219 #endif
220
221 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
222
223
224 #ifndef FT_BASE
225
226 #ifdef __cplusplus
227 #define FT_BASE( x )  extern "C"  x
228 #else
229 #define FT_BASE( x )  extern  x
230 #endif
231
232 #endif /* !FT_BASE */
233
234
235 #ifndef FT_BASE_DEF
236
237 #ifdef __cplusplus
238 #define FT_BASE_DEF( x )  extern "C"  x
239 #else
240 #define FT_BASE_DEF( x )  extern  x
241 #endif
242
243 #endif /* !FT_BASE_DEF */
244
245
246 #ifndef FT_EXPORT
247
248 #ifdef __cplusplus
249 #define FT_EXPORT( x )  extern "C"  x
250 #else
251 #define FT_EXPORT( x )  extern  x
252 #endif
253
254 #endif /* !FT_EXPORT */
255
256
257 #ifndef FT_EXPORT_DEF
258
259 #ifdef __cplusplus
260 #define FT_EXPORT_DEF( x )  extern "C"  x
261 #else
262 #define FT_EXPORT_DEF( x )  extern  x
263 #endif
264
265 #endif /* !FT_EXPORT_DEF */
266
267
268 #ifndef FT_EXPORT_VAR
269
270 #ifdef __cplusplus
271 #define FT_EXPORT_VAR( x )  extern "C"  x
272 #else
273 #define FT_EXPORT_VAR( x )  extern  x
274 #endif
275
276 #endif /* !FT_EXPORT_VAR */
277
278   /* The following macros are needed to compile the library with a   */
279   /* C++ compiler and with 16bit compilers.                          */
280   /*                                                                 */
281
282   /* This is special.  Within C++, you must specify `extern "C"' for */
283   /* functions which are used via function pointers, and you also    */
284   /* must do that for structures which contain function pointers to  */
285   /* assure C linkage -- it's not possible to have (local) anonymous */
286   /* functions which are accessed by (global) function pointers.     */
287   /*                                                                 */
288   /*                                                                 */
289   /* FT_CALLBACK_DEF is used to _define_ a callback function.        */
290   /*                                                                 */
291   /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
292   /* contains pointers to callback functions.                        */
293   /*                                                                 */
294   /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */
295   /* that contains pointers to callback functions.                   */
296   /*                                                                 */
297   /*                                                                 */
298   /* Some 16bit compilers have to redefine these macros to insert    */
299   /* the infamous `_cdecl' or `__fastcall' declarations.             */
300   /*                                                                 */
301 #ifndef FT_CALLBACK_DEF
302 #ifdef __cplusplus
303 #define FT_CALLBACK_DEF( x )  extern "C" x
304 #else
305 #define FT_CALLBACK_DEF( x )  static x
306 #endif
307 #endif /* FT_CALLBACK_DEF */
308
309 #ifndef FT_CALLBACK_TABLE
310 #ifdef __cplusplus
311 #define FT_CALLBACK_TABLE      extern "C"
312 #define FT_CALLBACK_TABLE_DEF  extern "C"
313 #else
314 #define FT_CALLBACK_TABLE      extern
315 #define FT_CALLBACK_TABLE_DEF  /* nothing */
316 #endif
317 #endif /* FT_CALLBACK_TABLE */
318
319
320 FT_END_HEADER
321
322
323 #endif /* __FTCONFIG_H__ */
324
325
326 /* END */