1 /***************************************************************************/
5 /* VMS-specific configuration file (specification only). */
7 /* Copyright 1996-2018 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
16 /***************************************************************************/
19 /*************************************************************************/
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 */
27 /* Note however that if some specific modifications are needed, we */
28 /* advise you to place a modified copy in your build directory. */
30 /* The build directory is usually `builds/<system>', and contains */
31 /* system-specific files that are always included first when building */
34 /*************************************************************************/
41 #include FT_CONFIG_OPTIONS_H
42 #include FT_CONFIG_STANDARD_LIBRARY_H
48 /*************************************************************************/
50 /* PLATFORM-SPECIFIC CONFIGURATION MACROS */
52 /* These macros can be toggled to suit a specific system. The current */
53 /* ones are defaults used to compile FreeType in an ANSI C environment */
54 /* (16bit compilers are also supported). Copy this file to your own */
55 /* `builds/<system>' directory, and edit it to port the engine. */
57 /*************************************************************************/
60 #define HAVE_UNISTD_H 1
61 #define HAVE_FCNTL_H 1
66 #define FT_SIZEOF_INT 4
67 #define FT_SIZEOF_LONG 4
72 /* FT_UNUSED is a macro used to indicate that a given parameter is not */
73 /* used -- this is only used to get rid of unpleasant compiler warnings */
75 #define FT_UNUSED( arg ) ( (arg) = (arg) )
79 /*************************************************************************/
81 /* AUTOMATIC CONFIGURATION MACROS */
83 /* These macros are computed from the ones defined above. Don't touch */
84 /* their definition, unless you know precisely what you are doing. No */
85 /* porter should need to mess with them. */
87 /*************************************************************************/
90 /*************************************************************************/
94 /* This is the only necessary change, so it is defined here instead */
95 /* providing a new configuration file. */
97 #if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
98 /* no Carbon frameworks for 64bit 10.4.x */
99 /* AvailabilityMacros.h is available since Mac OS X 10.2, */
100 /* so guess the system version by maximum errno before inclusion */
102 #ifdef ECANCELED /* defined since 10.2 */
103 #include "AvailabilityMacros.h"
105 #if defined( __LP64__ ) && \
106 ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
110 #elif defined( __SC__ ) || defined( __MRC__ )
111 /* Classic MacOS compilers */
112 #include "ConditionalMacros.h"
114 #define FT_MACINTOSH 1
120 /* Fix compiler warning with sgi compiler */
121 #if defined( __sgi ) && !defined( __GNUC__ )
122 #if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
123 #pragma set woff 3505
128 /*************************************************************************/
133 /*************************************************************************/
136 /*************************************************************************/
142 /* A typedef for a 16bit signed integer type. */
144 typedef signed short FT_Int16;
147 /*************************************************************************/
153 /* A typedef for a 16bit unsigned integer type. */
155 typedef unsigned short FT_UInt16;
160 /* this #if 0 ... #endif clause is for documentation purposes */
163 /*************************************************************************/
169 /* A typedef for a 32bit signed integer type. The size depends on */
170 /* the configuration. */
172 typedef signed XXX FT_Int32;
175 /*************************************************************************/
180 /* A typedef for a 32bit unsigned integer type. The size depends on */
181 /* the configuration. */
183 typedef unsigned XXX FT_UInt32;
186 /*************************************************************************/
191 /* A typedef for a 64bit signed integer type. The size depends on */
192 /* the configuration. Only defined if there is real 64bit support; */
193 /* otherwise, it gets emulated with a structure (if necessary). */
195 typedef signed XXX FT_Int64;
198 /*************************************************************************/
203 /* A typedef for a 64bit unsigned integer type. The size depends on */
204 /* the configuration. Only defined if there is real 64bit support; */
205 /* otherwise, it gets emulated with a structure (if necessary). */
207 typedef unsigned XXX FT_UInt64;
213 #if FT_SIZEOF_INT == 4
215 typedef signed int FT_Int32;
216 typedef unsigned int FT_UInt32;
218 #elif FT_SIZEOF_LONG == 4
220 typedef signed long FT_Int32;
221 typedef unsigned long FT_UInt32;
224 #error "no 32bit type found -- please check your configuration files"
228 /* look up an integer type that is at least 32 bits */
229 #if FT_SIZEOF_INT >= 4
232 typedef unsigned int FT_UFast;
234 #elif FT_SIZEOF_LONG >= 4
236 typedef long FT_Fast;
237 typedef unsigned long FT_UFast;
242 /* determine whether we have a 64-bit int type */
243 /* (mostly for environments without `autoconf') */
244 #if FT_SIZEOF_LONG == 8
246 /* FT_LONG64 must be defined if a 64-bit type is available */
248 #define FT_INT64 long
249 #define FT_UINT64 unsigned long
251 /* we handle the LLP64 scheme separately for GCC and clang, */
252 /* suppressing the `long long' warning */
253 #elif ( FT_SIZEOF_LONG == 4 ) && \
254 defined( HAVE_LONG_LONG_INT ) && \
256 #pragma GCC diagnostic ignored "-Wlong-long"
258 #define FT_INT64 long long int
259 #define FT_UINT64 unsigned long long int
261 /*************************************************************************/
263 /* A 64-bit data type may create compilation problems if you compile */
264 /* in strict ANSI mode. To avoid them, we disable other 64-bit data */
265 /* types if __STDC__ is defined. You can however ignore this rule */
266 /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
268 #elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
270 #if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
273 #define FT_INT64 long long int
274 #define FT_UINT64 unsigned long long int
276 #elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
278 /* this compiler provides the __int64 type */
280 #define FT_INT64 __int64
281 #define FT_UINT64 unsigned __int64
283 #elif defined( __BORLANDC__ ) /* Borland C++ */
285 /* XXXX: We should probably check the value of __BORLANDC__ in order */
286 /* to test the compiler version. */
288 /* this compiler provides the __int64 type */
290 #define FT_INT64 __int64
291 #define FT_UINT64 unsigned __int64
293 #elif defined( __WATCOMC__ ) /* Watcom C++ */
295 /* Watcom doesn't provide 64-bit data types */
297 #elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
300 #define FT_INT64 long long int
301 #define FT_UINT64 unsigned long long int
303 #elif defined( __GNUC__ )
305 /* GCC provides the `long long' type */
307 #define FT_INT64 long long int
308 #define FT_UINT64 unsigned long long int
310 #endif /* __STDC_VERSION__ >= 199901L */
312 #endif /* FT_SIZEOF_LONG == 8 */
315 typedef FT_INT64 FT_Int64;
316 typedef FT_UINT64 FT_UInt64;
321 /* only 64bit Windows uses the LLP64 data model, i.e., */
322 /* 32bit integers, 64bit pointers */
323 #define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
325 #define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
329 /*************************************************************************/
333 /*************************************************************************/
336 #define FT_BEGIN_STMNT do {
337 #define FT_END_STMNT } while ( 0 )
338 #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
341 /* typeof condition taken from gnulib's `intprops.h' header file */
342 #if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
343 ( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
344 defined( __IBM__TYPEOF__ ) ) || \
345 ( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
346 #define FT_TYPEOF( type ) ( __typeof__ ( type ) )
348 #define FT_TYPEOF( type ) /* empty */
352 /* Use FT_LOCAL and FT_LOCAL_DEF to declare and define, respectively, */
353 /* a function that gets used only within the scope of a module. */
354 /* Normally, both the header and source code files for such a */
355 /* function are within a single module directory. */
357 /* Intra-module arrays should be tagged with FT_LOCAL_ARRAY and */
358 /* FT_LOCAL_ARRAY_DEF. */
360 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
362 #define FT_LOCAL( x ) static x
363 #define FT_LOCAL_DEF( x ) static x
368 #define FT_LOCAL( x ) extern "C" x
369 #define FT_LOCAL_DEF( x ) extern "C" x
371 #define FT_LOCAL( x ) extern x
372 #define FT_LOCAL_DEF( x ) x
375 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
377 #define FT_LOCAL_ARRAY( x ) extern const x
378 #define FT_LOCAL_ARRAY_DEF( x ) const x
381 /* Use FT_BASE and FT_BASE_DEF to declare and define, respectively, */
382 /* functions that are used in more than a single module. In the */
383 /* current setup this implies that the declaration is in a header */
384 /* file in the `include/freetype/internal' directory, and the */
385 /* function body is in a file in `src/base'. */
390 #define FT_BASE( x ) extern "C" x
392 #define FT_BASE( x ) extern x
395 #endif /* !FT_BASE */
401 #define FT_BASE_DEF( x ) x
403 #define FT_BASE_DEF( x ) x
406 #endif /* !FT_BASE_DEF */
409 /* When compiling FreeType as a DLL, some systems/compilers need a */
410 /* special attribute in front OR after the return type of function */
413 /* Two macros are used within the FreeType source code to define */
414 /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
416 /* FT_EXPORT( return_type ) */
418 /* is used in a function declaration, as in */
420 /* FT_EXPORT( FT_Error ) */
421 /* FT_Init_FreeType( FT_Library* alibrary ); */
424 /* FT_EXPORT_DEF( return_type ) */
426 /* is used in a function definition, as in */
428 /* FT_EXPORT_DEF( FT_Error ) */
429 /* FT_Init_FreeType( FT_Library* alibrary ) */
431 /* ... some code ... */
432 /* return FT_Err_Ok; */
435 /* You can provide your own implementation of FT_EXPORT and */
436 /* FT_EXPORT_DEF here if you want. */
438 /* To export a variable, use FT_EXPORT_VAR. */
443 #define FT_EXPORT( x ) extern "C" x
445 #define FT_EXPORT( x ) extern x
448 #endif /* !FT_EXPORT */
451 #ifndef FT_EXPORT_DEF
454 #define FT_EXPORT_DEF( x ) extern "C" x
456 #define FT_EXPORT_DEF( x ) extern x
459 #endif /* !FT_EXPORT_DEF */
462 #ifndef FT_EXPORT_VAR
465 #define FT_EXPORT_VAR( x ) extern "C" x
467 #define FT_EXPORT_VAR( x ) extern x
470 #endif /* !FT_EXPORT_VAR */
472 /* The following macros are needed to compile the library with a */
473 /* C++ compiler and with 16bit compilers. */
476 /* This is special. Within C++, you must specify `extern "C"' for */
477 /* functions which are used via function pointers, and you also */
478 /* must do that for structures which contain function pointers to */
479 /* assure C linkage -- it's not possible to have (local) anonymous */
480 /* functions which are accessed by (global) function pointers. */
483 /* FT_CALLBACK_DEF is used to _define_ a callback function, */
484 /* located in the same source code file as the structure that uses */
487 /* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
488 /* and define a callback function, respectively, in a similar way */
489 /* as FT_BASE and FT_BASE_DEF work. */
491 /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
492 /* contains pointers to callback functions. */
494 /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
495 /* that contains pointers to callback functions. */
498 /* Some 16bit compilers have to redefine these macros to insert */
499 /* the infamous `_cdecl' or `__fastcall' declarations. */
501 #ifndef FT_CALLBACK_DEF
503 #define FT_CALLBACK_DEF( x ) extern "C" x
505 #define FT_CALLBACK_DEF( x ) static x
507 #endif /* FT_CALLBACK_DEF */
509 #ifndef FT_BASE_CALLBACK
511 #define FT_BASE_CALLBACK( x ) extern "C" x
512 #define FT_BASE_CALLBACK_DEF( x ) extern "C" x
514 #define FT_BASE_CALLBACK( x ) extern x
515 #define FT_BASE_CALLBACK_DEF( x ) x
517 #endif /* FT_BASE_CALLBACK */
519 #ifndef FT_CALLBACK_TABLE
521 #define FT_CALLBACK_TABLE extern "C"
522 #define FT_CALLBACK_TABLE_DEF extern "C"
524 #define FT_CALLBACK_TABLE extern
525 #define FT_CALLBACK_TABLE_DEF /* nothing */
527 #endif /* FT_CALLBACK_TABLE */
533 #endif /* FTCONFIG_H_ */