cnFontGen

Tool to convert a font file to a large png glyph for game engines
Log | Files | Refs

ftconfig.h (12308B)


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