Home | History | Annotate | Download | only in vms
      1 /***************************************************************************/
      2 /*                                                                         */
      3 /*  ftconfig.h                                                             */
      4 /*                                                                         */
      5 /*    VMS-specific configuration file (specification only).                */
      6 /*                                                                         */
      7 /*  Copyright 1996-2015 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 `builds/<system>', and contains        */
     31   /* system-specific files that are always included first when building    */
     32   /* the library.                                                          */
     33   /*                                                                       */
     34   /*************************************************************************/
     35 
     36 #ifndef __FTCONFIG_H__
     37 #define __FTCONFIG_H__
     38 
     39 #include <ft2build.h>
     40 #include FT_CONFIG_OPTIONS_H
     41 #include FT_CONFIG_STANDARD_LIBRARY_H
     42 
     43 
     44 FT_BEGIN_HEADER
     45 
     46 
     47   /*************************************************************************/
     48   /*                                                                       */
     49   /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */
     50   /*                                                                       */
     51   /* These macros can be toggled to suit a specific system.  The current   */
     52   /* ones are defaults used to compile FreeType in an ANSI C environment   */
     53   /* (16bit compilers are also supported).  Copy this file to your own     */
     54   /* `builds/<system>' directory, and edit it to port the engine.          */
     55   /*                                                                       */
     56   /*************************************************************************/
     57 
     58 
     59 #define HAVE_UNISTD_H  1
     60 #define HAVE_FCNTL_H   1
     61 
     62 #define SIZEOF_INT   4
     63 #define SIZEOF_LONG  4
     64 
     65 #define FT_SIZEOF_INT   4
     66 #define FT_SIZEOF_LONG  4
     67 
     68 #define FT_CHAR_BIT  8
     69 
     70 
     71   /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
     72   /* used -- this is only used to get rid of unpleasant compiler warnings */
     73 #ifndef FT_UNUSED
     74 #define FT_UNUSED( arg )  ( (arg) = (arg) )
     75 #endif
     76 
     77 
     78   /*************************************************************************/
     79   /*                                                                       */
     80   /*                     AUTOMATIC CONFIGURATION MACROS                    */
     81   /*                                                                       */
     82   /* These macros are computed from the ones defined above.  Don't touch   */
     83   /* their definition, unless you know precisely what you are doing.  No   */
     84   /* porter should need to mess with them.                                 */
     85   /*                                                                       */
     86   /*************************************************************************/
     87 
     88 
     89   /*************************************************************************/
     90   /*                                                                       */
     91   /* Mac support                                                           */
     92   /*                                                                       */
     93   /*   This is the only necessary change, so it is defined here instead    */
     94   /*   providing a new configuration file.                                 */
     95   /*                                                                       */
     96 #if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
     97   /* no Carbon frameworks for 64bit 10.4.x */
     98   /* AvailabilityMacros.h is available since Mac OS X 10.2,        */
     99   /* so guess the system version by maximum errno before inclusion */
    100 #include <errno.h>
    101 #ifdef ECANCELED /* defined since 10.2 */
    102 #include "AvailabilityMacros.h"
    103 #endif
    104 #if defined( __LP64__ ) && \
    105     ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
    106 #undef FT_MACINTOSH
    107 #endif
    108 
    109 #elif defined( __SC__ ) || defined( __MRC__ )
    110   /* Classic MacOS compilers */
    111 #include "ConditionalMacros.h"
    112 #if TARGET_OS_MAC
    113 #define FT_MACINTOSH 1
    114 #endif
    115 
    116 #endif
    117 
    118 
    119   /*************************************************************************/
    120   /*                                                                       */
    121   /* <Section>                                                             */
    122   /*    basic_types                                                        */
    123   /*                                                                       */
    124   /*************************************************************************/
    125 
    126 
    127   /*************************************************************************/
    128   /*                                                                       */
    129   /* <Type>                                                                */
    130   /*    FT_Int16                                                           */
    131   /*                                                                       */
    132   /* <Description>                                                         */
    133   /*    A typedef for a 16bit signed integer type.                         */
    134   /*                                                                       */
    135   typedef signed short  FT_Int16;
    136 
    137 
    138   /*************************************************************************/
    139   /*                                                                       */
    140   /* <Type>                                                                */
    141   /*    FT_UInt16                                                          */
    142   /*                                                                       */
    143   /* <Description>                                                         */
    144   /*    A typedef for a 16bit unsigned integer type.                       */
    145   /*                                                                       */
    146   typedef unsigned short  FT_UInt16;
    147 
    148   /* */
    149 
    150 
    151   /* this #if 0 ... #endif clause is for documentation purposes */
    152 #if 0
    153 
    154   /*************************************************************************/
    155   /*                                                                       */
    156   /* <Type>                                                                */
    157   /*    FT_Int32                                                           */
    158   /*                                                                       */
    159   /* <Description>                                                         */
    160   /*    A typedef for a 32bit signed integer type.  The size depends on    */
    161   /*    the configuration.                                                 */
    162   /*                                                                       */
    163   typedef signed XXX  FT_Int32;
    164 
    165 
    166   /*************************************************************************/
    167   /*                                                                       */
    168   /* <Type>                                                                */
    169   /*    FT_UInt32                                                          */
    170   /*                                                                       */
    171   /*    A typedef for a 32bit unsigned integer type.  The size depends on  */
    172   /*    the configuration.                                                 */
    173   /*                                                                       */
    174   typedef unsigned XXX  FT_UInt32;
    175 
    176 
    177   /*************************************************************************/
    178   /*                                                                       */
    179   /* <Type>                                                                */
    180   /*    FT_Int64                                                           */
    181   /*                                                                       */
    182   /*    A typedef for a 64bit signed integer type.  The size depends on    */
    183   /*    the configuration.  Only defined if there is real 64bit support;   */
    184   /*    otherwise, it gets emulated with a structure (if necessary).       */
    185   /*                                                                       */
    186   typedef signed XXX  FT_Int64;
    187 
    188 
    189   /*************************************************************************/
    190   /*                                                                       */
    191   /* <Type>                                                                */
    192   /*    FT_UInt64                                                          */
    193   /*                                                                       */
    194   /*    A typedef for a 64bit unsigned integer type.  The size depends on  */
    195   /*    the configuration.  Only defined if there is real 64bit support;   */
    196   /*    otherwise, it gets emulated with a structure (if necessary).       */
    197   /*                                                                       */
    198   typedef unsigned XXX  FT_UInt64;
    199 
    200   /* */
    201 
    202 #endif
    203 
    204 #if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
    205 
    206   typedef signed int      FT_Int32;
    207   typedef unsigned int    FT_UInt32;
    208 
    209 #elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
    210 
    211   typedef signed long     FT_Int32;
    212   typedef unsigned long   FT_UInt32;
    213 
    214 #else
    215 #error "no 32bit type found -- please check your configuration files"
    216 #endif
    217 
    218 
    219   /* look up an integer type that is at least 32 bits */
    220 #if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
    221 
    222   typedef int            FT_Fast;
    223   typedef unsigned int   FT_UFast;
    224 
    225 #elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
    226 
    227   typedef long           FT_Fast;
    228   typedef unsigned long  FT_UFast;
    229 
    230 #endif
    231 
    232 
    233   /* determine whether we have a 64-bit int type for platforms without */
    234   /* Autoconf                                                          */
    235 #if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
    236 
    237   /* FT_LONG64 must be defined if a 64-bit type is available */
    238 #define FT_LONG64
    239 #define FT_INT64   long
    240 #define FT_UINT64  unsigned long
    241 
    242   /*************************************************************************/
    243   /*                                                                       */
    244   /* A 64-bit data type may create compilation problems if you compile     */
    245   /* in strict ANSI mode.  To avoid them, we disable other 64-bit data     */
    246   /* types if __STDC__ is defined.  You can however ignore this rule       */
    247   /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.     */
    248   /*                                                                       */
    249 #elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
    250 
    251 #if defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */
    252 
    253   /* this compiler provides the __int64 type */
    254 #define FT_LONG64
    255 #define FT_INT64   __int64
    256 #define FT_UINT64  unsigned __int64
    257 
    258 #elif defined( __BORLANDC__ )  /* Borland C++ */
    259 
    260   /* XXXX: We should probably check the value of __BORLANDC__ in order */
    261   /*       to test the compiler version.                               */
    262 
    263   /* this compiler provides the __int64 type */
    264 #define FT_LONG64
    265 #define FT_INT64   __int64
    266 #define FT_UINT64  unsigned __int64
    267 
    268 #elif defined( __WATCOMC__ )   /* Watcom C++ */
    269 
    270   /* Watcom doesn't provide 64-bit data types */
    271 
    272 #elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */
    273 
    274 #define FT_LONG64
    275 #define FT_INT64   long long int
    276 #define FT_UINT64  unsigned long long int
    277 
    278 #elif defined( __GNUC__ )
    279 
    280   /* GCC provides the `long long' type */
    281 #define FT_LONG64
    282 #define FT_INT64   long long int
    283 #define FT_UINT64  unsigned long long int
    284 
    285 #endif /* _MSC_VER */
    286 
    287 #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
    288 
    289 #ifdef FT_LONG64
    290   typedef FT_INT64   FT_Int64;
    291   typedef FT_UINT64  FT_UInt64;
    292 #endif
    293 
    294 
    295   /*************************************************************************/
    296   /*                                                                       */
    297   /* miscellaneous                                                         */
    298   /*                                                                       */
    299   /*************************************************************************/
    300 
    301 
    302 #define FT_BEGIN_STMNT  do {
    303 #define FT_END_STMNT    } while ( 0 )
    304 #define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
    305 
    306 
    307   /* typeof condition taken from gnulib's `intprops.h' header file */
    308 #if ( __GNUC__ >= 2                         || \
    309       defined( __IBM__TYPEOF__ )            || \
    310       ( __SUNPRO_C >= 0x5110 && !__STDC__ ) )
    311 #define FT_TYPEOF( type )  (__typeof__ (type))
    312 #else
    313 #define FT_TYPEOF( type )  /* empty */
    314 #endif
    315 
    316 
    317 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
    318 
    319 #define FT_LOCAL( x )      static  x
    320 #define FT_LOCAL_DEF( x )  static  x
    321 
    322 #else
    323 
    324 #ifdef __cplusplus
    325 #define FT_LOCAL( x )      extern "C"  x
    326 #define FT_LOCAL_DEF( x )  extern "C"  x
    327 #else
    328 #define FT_LOCAL( x )      extern  x
    329 #define FT_LOCAL_DEF( x )  x
    330 #endif
    331 
    332 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
    333 
    334 #define FT_LOCAL_ARRAY( x )      extern const  x
    335 #define FT_LOCAL_ARRAY_DEF( x )  const  x
    336 
    337 
    338 #ifndef FT_BASE
    339 
    340 #ifdef __cplusplus
    341 #define FT_BASE( x )  extern "C"  x
    342 #else
    343 #define FT_BASE( x )  extern  x
    344 #endif
    345 
    346 #endif /* !FT_BASE */
    347 
    348 
    349 #ifndef FT_BASE_DEF
    350 
    351 #ifdef __cplusplus
    352 #define FT_BASE_DEF( x )  x
    353 #else
    354 #define FT_BASE_DEF( x )  x
    355 #endif
    356 
    357 #endif /* !FT_BASE_DEF */
    358 
    359 
    360 #ifndef FT_EXPORT
    361 
    362 #ifdef __cplusplus
    363 #define FT_EXPORT( x )  extern "C"  x
    364 #else
    365 #define FT_EXPORT( x )  extern  x
    366 #endif
    367 
    368 #endif /* !FT_EXPORT */
    369 
    370 
    371 #ifndef FT_EXPORT_DEF
    372 
    373 #ifdef __cplusplus
    374 #define FT_EXPORT_DEF( x )  extern "C"  x
    375 #else
    376 #define FT_EXPORT_DEF( x )  extern  x
    377 #endif
    378 
    379 #endif /* !FT_EXPORT_DEF */
    380 
    381 
    382 #ifndef FT_EXPORT_VAR
    383 
    384 #ifdef __cplusplus
    385 #define FT_EXPORT_VAR( x )  extern "C"  x
    386 #else
    387 #define FT_EXPORT_VAR( x )  extern  x
    388 #endif
    389 
    390 #endif /* !FT_EXPORT_VAR */
    391 
    392   /* The following macros are needed to compile the library with a   */
    393   /* C++ compiler and with 16bit compilers.                          */
    394   /*                                                                 */
    395 
    396   /* This is special.  Within C++, you must specify `extern "C"' for */
    397   /* functions which are used via function pointers, and you also    */
    398   /* must do that for structures which contain function pointers to  */
    399   /* assure C linkage -- it's not possible to have (local) anonymous */
    400   /* functions which are accessed by (global) function pointers.     */
    401   /*                                                                 */
    402   /*                                                                 */
    403   /* FT_CALLBACK_DEF is used to _define_ a callback function.        */
    404   /*                                                                 */
    405   /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
    406   /* contains pointers to callback functions.                        */
    407   /*                                                                 */
    408   /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */
    409   /* that contains pointers to callback functions.                   */
    410   /*                                                                 */
    411   /*                                                                 */
    412   /* Some 16bit compilers have to redefine these macros to insert    */
    413   /* the infamous `_cdecl' or `__fastcall' declarations.             */
    414   /*                                                                 */
    415 #ifndef FT_CALLBACK_DEF
    416 #ifdef __cplusplus
    417 #define FT_CALLBACK_DEF( x )  extern "C"  x
    418 #else
    419 #define FT_CALLBACK_DEF( x )  static  x
    420 #endif
    421 #endif /* FT_CALLBACK_DEF */
    422 
    423 #ifndef FT_CALLBACK_TABLE
    424 #ifdef __cplusplus
    425 #define FT_CALLBACK_TABLE      extern "C"
    426 #define FT_CALLBACK_TABLE_DEF  extern "C"
    427 #else
    428 #define FT_CALLBACK_TABLE      extern
    429 #define FT_CALLBACK_TABLE_DEF  /* nothing */
    430 #endif
    431 #endif /* FT_CALLBACK_TABLE */
    432 
    433 
    434 FT_END_HEADER
    435 
    436 
    437 #endif /* __FTCONFIG_H__ */
    438 
    439 
    440 /* END */
    441