ftconfig.h

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  ftconfig.h                                                             */
00004 /*                                                                         */
00005 /*    VMS-specific configuration file (specification only).                */
00006 /*                                                                         */
00007 /*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008 by             */
00008 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
00009 /*                                                                         */
00010 /*  This file is part of the FreeType project, and may only be used,       */
00011 /*  modified, and distributed under the terms of the FreeType project      */
00012 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00013 /*  this file you indicate that you have read the license and              */
00014 /*  understand and accept it fully.                                        */
00015 /*                                                                         */
00016 /***************************************************************************/
00017 
00018 
00019   /*************************************************************************/
00020   /*                                                                       */
00021   /* This header file contains a number of macro definitions that are used */
00022   /* by the rest of the engine.  Most of the macros here are automatically */
00023   /* determined at compile time, and you should not need to change it to   */
00024   /* port FreeType, except to compile the library with a non-ANSI          */
00025   /* compiler.                                                             */
00026   /*                                                                       */
00027   /* Note however that if some specific modifications are needed, we       */
00028   /* advise you to place a modified copy in your build directory.          */
00029   /*                                                                       */
00030   /* The build directory is usually `freetype/builds/<system>', and        */
00031   /* contains system-specific files that are always included first when    */
00032   /* building the library.                                                 */
00033   /*                                                                       */
00034   /*************************************************************************/
00035 
00036 
00037 #ifndef __FTCONFIG_H__
00038 #define __FTCONFIG_H__
00039 
00040 
00041   /* Include the header file containing all developer build options */
00042 #include <ft2build.h>
00043 #include FT_CONFIG_OPTIONS_H
00044 #include FT_CONFIG_STANDARD_LIBRARY_H
00045 
00046 
00047 FT_BEGIN_HEADER
00048 
00049   /*************************************************************************/
00050   /*                                                                       */
00051   /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */
00052   /*                                                                       */
00053   /* These macros can be toggled to suit a specific system.  The current   */
00054   /* ones are defaults used to compile FreeType in an ANSI C environment   */
00055   /* (16bit compilers are also supported).  Copy this file to your own     */
00056   /* `freetype/builds/<system>' directory, and edit it to port the engine. */
00057   /*                                                                       */
00058   /*************************************************************************/
00059 
00060 
00061 #define HAVE_UNISTD_H  1
00062 #define HAVE_FCNTL_H   1
00063 
00064 #define SIZEOF_INT   4
00065 #define SIZEOF_LONG  4
00066 
00067 #define FT_SIZEOF_INT   4
00068 #define FT_SIZEOF_LONG  4
00069 
00070 #define FT_CHAR_BIT  8
00071 
00072 
00073   /* Preferred alignment of data */
00074 #define FT_ALIGNMENT  8
00075 
00076 
00077   /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
00078   /* used -- this is only used to get rid of unpleasant compiler warnings */
00079 #ifndef FT_UNUSED
00080 #define FT_UNUSED( arg )  ( (arg) = (arg) )
00081 #endif
00082 
00083 
00084   /*************************************************************************/
00085   /*                                                                       */
00086   /*                     AUTOMATIC CONFIGURATION MACROS                    */
00087   /*                                                                       */
00088   /* These macros are computed from the ones defined above.  Don't touch   */
00089   /* their definition, unless you know precisely what you are doing.  No   */
00090   /* porter should need to mess with them.                                 */
00091   /*                                                                       */
00092   /*************************************************************************/
00093 
00094 
00095   /*************************************************************************/
00096   /*                                                                       */
00097   /* Mac support                                                           */
00098   /*                                                                       */
00099   /*   This is the only necessary change, so it is defined here instead    */
00100   /*   providing a new configuration file.                                 */
00101   /*                                                                       */
00102 #if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
00103     ( defined( __MWERKS__ ) && defined( macintosh )        )
00104   /* no Carbon frameworks for 64bit 10.4.x */
00105 #include "AvailabilityMacros.h"
00106 #if defined( __LP64__ ) && \
00107     ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
00108 #define DARWIN_NO_CARBON 1
00109 #else
00110 #define FT_MACINTOSH 1
00111 #endif
00112 
00113 #elif defined( __SC__ ) || defined( __MRC__ )
00114   /* Classic MacOS compilers */
00115 #include "ConditionalMacros.h"
00116 #if TARGET_OS_MAC
00117 #define FT_MACINTOSH 1
00118 #endif
00119 
00120 #endif
00121 
00122 
00123   /*************************************************************************/
00124   /*                                                                       */
00125   /* IntN types                                                            */
00126   /*                                                                       */
00127   /*   Used to guarantee the size of some specific integers.               */
00128   /*                                                                       */
00129   typedef signed short    FT_Int16;
00130   typedef unsigned short  FT_UInt16;
00131 
00132 #if FT_SIZEOF_INT == 4
00133 
00134   typedef signed int      FT_Int32;
00135   typedef unsigned int    FT_UInt32;
00136 
00137 #elif FT_SIZEOF_LONG == 4
00138 
00139   typedef signed long     FT_Int32;
00140   typedef unsigned long   FT_UInt32;
00141 
00142 #else
00143 #error "no 32bit type found -- please check your configuration files"
00144 #endif
00145 
00146   /* look up an integer type that is at least 32 bits */
00147 #if FT_SIZEOF_INT >= 4
00148 
00149   typedef int            FT_Fast;
00150   typedef unsigned int   FT_UFast;
00151 
00152 #elif FT_SIZEOF_LONG >= 4
00153 
00154   typedef long           FT_Fast;
00155   typedef unsigned long  FT_UFast;
00156 
00157 #endif
00158 
00159 
00160   /* determine whether we have a 64-bit int type for platforms without */
00161   /* Autoconf                                                          */
00162 #if FT_SIZEOF_LONG == 8
00163 
00164   /* FT_LONG64 must be defined if a 64-bit type is available */
00165 #define FT_LONG64
00166 #define FT_INT64  long
00167 
00168 #elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */
00169 
00170   /* this compiler provides the __int64 type */
00171 #define FT_LONG64
00172 #define FT_INT64  __int64
00173 
00174 #elif defined( __BORLANDC__ )  /* Borland C++ */
00175 
00176   /* XXXX: We should probably check the value of __BORLANDC__ in order */
00177   /*       to test the compiler version.                               */
00178 
00179   /* this compiler provides the __int64 type */
00180 #define FT_LONG64
00181 #define FT_INT64  __int64
00182 
00183 #elif defined( __WATCOMC__ )   /* Watcom C++ */
00184 
00185   /* Watcom doesn't provide 64-bit data types */
00186 
00187 #elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */
00188 
00189 #define FT_LONG64
00190 #define FT_INT64  long long int
00191 
00192 #elif defined( __GNUC__ )
00193 
00194   /* GCC provides the `long long' type */
00195 #define FT_LONG64
00196 #define FT_INT64  long long int
00197 
00198 #endif /* FT_SIZEOF_LONG == 8 */
00199 
00200 
00201 #define FT_BEGIN_STMNT  do {
00202 #define FT_END_STMNT    } while ( 0 )
00203 #define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
00204 
00205 
00206   /*************************************************************************/
00207   /*                                                                       */
00208   /* A 64-bit data type will create compilation problems if you compile    */
00209   /* in strict ANSI mode.  To avoid them, we disable their use if          */
00210   /* __STDC__ is defined.  You can however ignore this rule by             */
00211   /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.        */
00212   /*                                                                       */
00213 #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
00214 
00215 #ifdef __STDC__
00216 
00217   /* undefine the 64-bit macros in strict ANSI compilation mode */
00218 #undef FT_LONG64
00219 #undef FT_INT64
00220 
00221 #endif /* __STDC__ */
00222 
00223 #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
00224 
00225 
00226 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
00227 
00228 #define FT_LOCAL( x )      static  x
00229 #define FT_LOCAL_DEF( x )  static  x
00230 
00231 #else
00232 
00233 #ifdef __cplusplus
00234 #define FT_LOCAL( x )      extern "C"  x
00235 #define FT_LOCAL_DEF( x )  extern "C"  x
00236 #else
00237 #define FT_LOCAL( x )      extern  x
00238 #define FT_LOCAL_DEF( x )  x
00239 #endif
00240 
00241 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
00242 
00243 
00244 #ifndef FT_BASE
00245 
00246 #ifdef __cplusplus
00247 #define FT_BASE( x )  extern "C"  x
00248 #else
00249 #define FT_BASE( x )  extern  x
00250 #endif
00251 
00252 #endif /* !FT_BASE */
00253 
00254 
00255 #ifndef FT_BASE_DEF
00256 
00257 #ifdef __cplusplus
00258 #define FT_BASE_DEF( x )  extern "C"  x
00259 #else
00260 #define FT_BASE_DEF( x )  extern  x
00261 #endif
00262 
00263 #endif /* !FT_BASE_DEF */
00264 
00265 
00266 #ifndef FT_EXPORT
00267 
00268 #ifdef __cplusplus
00269 #define FT_EXPORT( x )  extern "C"  x
00270 #else
00271 #define FT_EXPORT( x )  extern  x
00272 #endif
00273 
00274 #endif /* !FT_EXPORT */
00275 
00276 
00277 #ifndef FT_EXPORT_DEF
00278 
00279 #ifdef __cplusplus
00280 #define FT_EXPORT_DEF( x )  extern "C"  x
00281 #else
00282 #define FT_EXPORT_DEF( x )  extern  x
00283 #endif
00284 
00285 #endif /* !FT_EXPORT_DEF */
00286 
00287 
00288 #ifndef FT_EXPORT_VAR
00289 
00290 #ifdef __cplusplus
00291 #define FT_EXPORT_VAR( x )  extern "C"  x
00292 #else
00293 #define FT_EXPORT_VAR( x )  extern  x
00294 #endif
00295 
00296 #endif /* !FT_EXPORT_VAR */
00297 
00298   /* The following macros are needed to compile the library with a   */
00299   /* C++ compiler and with 16bit compilers.                          */
00300   /*                                                                 */
00301 
00302   /* This is special.  Within C++, you must specify `extern "C"' for */
00303   /* functions which are used via function pointers, and you also    */
00304   /* must do that for structures which contain function pointers to  */
00305   /* assure C linkage -- it's not possible to have (local) anonymous */
00306   /* functions which are accessed by (global) function pointers.     */
00307   /*                                                                 */
00308   /*                                                                 */
00309   /* FT_CALLBACK_DEF is used to _define_ a callback function.        */
00310   /*                                                                 */
00311   /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
00312   /* contains pointers to callback functions.                        */
00313   /*                                                                 */
00314   /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */
00315   /* that contains pointers to callback functions.                   */
00316   /*                                                                 */
00317   /*                                                                 */
00318   /* Some 16bit compilers have to redefine these macros to insert    */
00319   /* the infamous `_cdecl' or `__fastcall' declarations.             */
00320   /*                                                                 */
00321 #ifndef FT_CALLBACK_DEF
00322 #ifdef __cplusplus
00323 #define FT_CALLBACK_DEF( x )  extern "C"  x
00324 #else
00325 #define FT_CALLBACK_DEF( x )  static  x
00326 #endif
00327 #endif /* FT_CALLBACK_DEF */
00328 
00329 #ifndef FT_CALLBACK_TABLE
00330 #ifdef __cplusplus
00331 #define FT_CALLBACK_TABLE      extern "C"
00332 #define FT_CALLBACK_TABLE_DEF  extern "C"
00333 #else
00334 #define FT_CALLBACK_TABLE      extern
00335 #define FT_CALLBACK_TABLE_DEF  /* nothing */
00336 #endif
00337 #endif /* FT_CALLBACK_TABLE */
00338 
00339 
00340 FT_END_HEADER
00341 
00342 
00343 #endif /* __FTCONFIG_H__ */
00344 
00345 
00346 /* END */

Generated on Tue Jul 5 14:13:34 2011 for ROOT_528-00b_version by  doxygen 1.5.1