ftconfig.h

Go to the documentation of this file.
00001 /* ftconfig.h.  Generated from ftconfig.in by configure.  */
00002 /***************************************************************************/
00003 /*                                                                         */
00004 /*  ftconfig.in                                                            */
00005 /*                                                                         */
00006 /*    UNIX-specific configuration file (specification only).               */
00007 /*                                                                         */
00008 /*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by       */
00009 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
00010 /*                                                                         */
00011 /*  This file is part of the FreeType project, and may only be used,       */
00012 /*  modified, and distributed under the terms of the FreeType project      */
00013 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00014 /*  this file you indicate that you have read the license and              */
00015 /*  understand and accept it fully.                                        */
00016 /*                                                                         */
00017 /***************************************************************************/
00018 
00019 
00020   /*************************************************************************/
00021   /*                                                                       */
00022   /* This header file contains a number of macro definitions that are used */
00023   /* by the rest of the engine.  Most of the macros here are automatically */
00024   /* determined at compile time, and you should not need to change it to   */
00025   /* port FreeType, except to compile the library with a non-ANSI          */
00026   /* compiler.                                                             */
00027   /*                                                                       */
00028   /* Note however that if some specific modifications are needed, we       */
00029   /* advise you to place a modified copy in your build directory.          */
00030   /*                                                                       */
00031   /* The build directory is usually `freetype/builds/<system>', and        */
00032   /* contains system-specific files that are always included first when    */
00033   /* building the library.                                                 */
00034   /*                                                                       */
00035   /*************************************************************************/
00036 
00037 
00038 #ifndef __FTCONFIG_H__
00039 #define __FTCONFIG_H__
00040 
00041 #include <ft2build.h>
00042 #include FT_CONFIG_OPTIONS_H
00043 #include FT_CONFIG_STANDARD_LIBRARY_H
00044 
00045 
00046 FT_BEGIN_HEADER
00047 
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 #define HAVE_STDINT_H 1
00064 
00065 
00066   /* There are systems (like the Texas Instruments 'C54x) where a `char' */
00067   /* has 16 bits.  ANSI C says that sizeof(char) is always 1.  Since an  */
00068   /* `int' has 16 bits also for this system, sizeof(int) gives 1 which   */
00069   /* is probably unexpected.                                             */
00070   /*                                                                     */
00071   /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a      */
00072   /* `char' type.                                                        */
00073 
00074 #ifndef FT_CHAR_BIT
00075 #define FT_CHAR_BIT  CHAR_BIT
00076 #endif
00077 
00078 
00079 /* #undef FT_USE_AUTOCONF_SIZEOF_TYPES */
00080 #ifdef FT_USE_AUTOCONF_SIZEOF_TYPES
00081 
00082 #define SIZEOF_INT 4
00083 #define SIZEOF_LONG 4
00084 #define FT_SIZEOF_INT  SIZEOF_INT
00085 #define FT_SIZEOF_LONG SIZEOF_LONG
00086 
00087 #else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
00088 
00089   /* Following cpp computation of the bit length of int and long */
00090   /* is copied from default include/freetype/config/ftconfig.h.  */
00091   /* If any improvement is required for this file, it should be  */
00092   /* applied to the original header file for the builders that   */
00093   /* does not use configure script.                              */
00094 
00095   /* The size of an `int' type.  */
00096 #if                                 FT_UINT_MAX == 0xFFFFUL
00097 #define FT_SIZEOF_INT  (16 / FT_CHAR_BIT)
00098 #elif                               FT_UINT_MAX == 0xFFFFFFFFUL
00099 #define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)
00100 #elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
00101 #define FT_SIZEOF_INT  (64 / FT_CHAR_BIT)
00102 #else
00103 #error "Unsupported size of `int' type!"
00104 #endif
00105 
00106   /* The size of a `long' type.  A five-byte `long' (as used e.g. on the */
00107   /* DM642) is recognized but avoided.                                   */
00108 #if                                  FT_ULONG_MAX == 0xFFFFFFFFUL
00109 #define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)
00110 #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
00111 #define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)
00112 #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
00113 #define FT_SIZEOF_LONG  (64 / FT_CHAR_BIT)
00114 #else
00115 #error "Unsupported size of `long' type!"
00116 #endif
00117 
00118 #endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
00119 
00120 
00121   /* Preferred alignment of data */
00122 #define FT_ALIGNMENT  8
00123 
00124 
00125   /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
00126   /* used -- this is only used to get rid of unpleasant compiler warnings */
00127 #ifndef FT_UNUSED
00128 #define FT_UNUSED( arg )  ( (arg) = (arg) )
00129 #endif
00130 
00131 
00132   /*************************************************************************/
00133   /*                                                                       */
00134   /*                     AUTOMATIC CONFIGURATION MACROS                    */
00135   /*                                                                       */
00136   /* These macros are computed from the ones defined above.  Don't touch   */
00137   /* their definition, unless you know precisely what you are doing.  No   */
00138   /* porter should need to mess with them.                                 */
00139   /*                                                                       */
00140   /*************************************************************************/
00141 
00142 
00143   /*************************************************************************/
00144   /*                                                                       */
00145   /* Mac support                                                           */
00146   /*                                                                       */
00147   /*   This is the only necessary change, so it is defined here instead    */
00148   /*   providing a new configuration file.                                 */
00149   /*                                                                       */
00150 #if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
00151     ( defined( __MWERKS__ ) && defined( macintosh )        )
00152   /* no Carbon frameworks for 64bit 10.4.x */
00153 #include "AvailabilityMacros.h"
00154 #if defined( __LP64__ ) && \
00155     ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
00156 #define DARWIN_NO_CARBON 1
00157 #else
00158 #define FT_MACINTOSH 1
00159 #endif
00160 
00161 #elif defined( __SC__ ) || defined( __MRC__ )
00162   /* Classic MacOS compilers */
00163 #include "ConditionalMacros.h"
00164 #if TARGET_OS_MAC
00165 #define FT_MACINTOSH 1
00166 #endif
00167 
00168 #endif
00169 
00170 
00171   /* Fix compiler warning with sgi compiler */
00172 #if defined( __sgi ) && !defined( __GNUC__ )
00173 #if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
00174 #pragma set woff 3505
00175 #endif
00176 #endif
00177 
00178 
00179   /*************************************************************************/
00180   /*                                                                       */
00181   /* IntN types                                                            */
00182   /*                                                                       */
00183   /*   Used to guarantee the size of some specific integers.               */
00184   /*                                                                       */
00185   typedef signed short    FT_Int16;
00186   typedef unsigned short  FT_UInt16;
00187 
00188 #if FT_SIZEOF_INT == 4
00189 
00190   typedef signed int      FT_Int32;
00191   typedef unsigned int    FT_UInt32;
00192 
00193 #elif FT_SIZEOF_LONG == 4
00194 
00195   typedef signed long     FT_Int32;
00196   typedef unsigned long   FT_UInt32;
00197 
00198 #else
00199 #error "no 32bit type found -- please check your configuration files"
00200 #endif
00201 
00202 
00203   /* look up an integer type that is at least 32 bits */
00204 #if FT_SIZEOF_INT >= 4
00205 
00206   typedef int            FT_Fast;
00207   typedef unsigned int   FT_UFast;
00208 
00209 #elif FT_SIZEOF_LONG >= 4
00210 
00211   typedef long           FT_Fast;
00212   typedef unsigned long  FT_UFast;
00213 
00214 #endif
00215 
00216 
00217   /* determine whether we have a 64-bit int type for platforms without */
00218   /* Autoconf                                                          */
00219 #if FT_SIZEOF_LONG == 8
00220 
00221   /* FT_LONG64 must be defined if a 64-bit type is available */
00222 #define FT_LONG64
00223 #define FT_INT64  long
00224 
00225 #elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */
00226 
00227   /* this compiler provides the __int64 type */
00228 #define FT_LONG64
00229 #define FT_INT64  __int64
00230 
00231 #elif defined( __BORLANDC__ )  /* Borland C++ */
00232 
00233   /* XXXX: We should probably check the value of __BORLANDC__ in order */
00234   /*       to test the compiler version.                               */
00235 
00236   /* this compiler provides the __int64 type */
00237 #define FT_LONG64
00238 #define FT_INT64  __int64
00239 
00240 #elif defined( __WATCOMC__ )   /* Watcom C++ */
00241 
00242   /* Watcom doesn't provide 64-bit data types */
00243 
00244 #elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */
00245 
00246 #define FT_LONG64
00247 #define FT_INT64  long long int
00248 
00249 #elif defined( __GNUC__ )
00250 
00251   /* GCC provides the `long long' type */
00252 #define FT_LONG64
00253 #define FT_INT64  long long int
00254 
00255 #endif /* FT_SIZEOF_LONG == 8 */
00256 
00257 
00258   /*************************************************************************/
00259   /*                                                                       */
00260   /* A 64-bit data type will create compilation problems if you compile    */
00261   /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */
00262   /* is defined.  You can however ignore this rule by defining the         */
00263   /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */
00264   /*                                                                       */
00265 #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
00266 
00267 #ifdef __STDC__
00268 
00269   /* Undefine the 64-bit macros in strict ANSI compilation mode.  */
00270   /* Since `#undef' doesn't survive in configuration header files */
00271   /* we use the postprocessing facility of AC_CONFIG_HEADERS to   */
00272   /* replace the leading `/' with `#'.                            */
00273 #undef FT_LONG64
00274 #undef FT_INT64
00275 
00276 #endif /* __STDC__ */
00277 
00278 #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
00279 
00280 
00281 #define FT_BEGIN_STMNT  do {
00282 #define FT_END_STMNT    } while ( 0 )
00283 #define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT
00284 
00285 
00286 #ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER
00287   /* Provide assembler fragments for performance-critical functions. */
00288   /* These must be defined `static __inline__' with GCC.             */
00289 
00290 #ifdef __GNUC__
00291 
00292 #if defined( __arm__ ) && !defined( __thumb__ )
00293 #define FT_MULFIX_ASSEMBLER  FT_MulFix_arm
00294 
00295   static __inline__ FT_Int32
00296   FT_MulFix_arm( FT_Int32  a,
00297                  FT_Int32  b )
00298   {
00299     register FT_Int32  t, t2;
00300 
00301 
00302     __asm__ __volatile__ (
00303       "smull  %1, %2, %4, %3\n\t"       /* (lo=%1,hi=%2) = a*b */
00304       "mov    %0, %2, asr #31\n\t"      /* %0  = (hi >> 31) */
00305       "add    %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
00306       "adds   %1, %1, %0\n\t"           /* %1 += %0 */
00307       "adc    %2, %2, #0\n\t"           /* %2 += carry */
00308       "mov    %0, %1, lsr #16\n\t"      /* %0  = %1 >> 16 */
00309       "orr    %0, %0, %2, lsl #16\n\t"  /* %0 |= %2 << 16 */
00310       : "=r"(a), "=&r"(t2), "=&r"(t)
00311       : "r"(a), "r"(b) );
00312     return a;
00313   }
00314 
00315 #endif /* __arm__ && !__thumb__ */
00316 
00317 #if defined( i386 )
00318 #define FT_MULFIX_ASSEMBLER  FT_MulFix_i386
00319 
00320   static __inline__ FT_Int32
00321   FT_MulFix_i386( FT_Int32  a,
00322                   FT_Int32  b )
00323   {
00324     register FT_Int32  result;
00325 
00326 
00327     __asm__ __volatile__ (
00328       "imul  %%edx\n"
00329       "movl  %%edx, %%ecx\n"
00330       "sarl  $31, %%ecx\n"
00331       "addl  $0x8000, %%ecx\n"
00332       "addl  %%ecx, %%eax\n"
00333       "adcl  $0, %%edx\n"
00334       "shrl  $16, %%eax\n"
00335       "shll  $16, %%edx\n"
00336       "addl  %%edx, %%eax\n"
00337       : "=a"(result), "+d"(b)
00338       : "a"(a)
00339       : "%ecx" );
00340     return result;
00341   }
00342 
00343 #endif /* i386 */
00344 
00345 #endif /* __GNUC__ */
00346 
00347 #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
00348 
00349 
00350 #ifdef FT_CONFIG_OPTION_INLINE_MULFIX
00351 #ifdef FT_MULFIX_ASSEMBLER
00352 #define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER
00353 #endif
00354 #endif
00355 
00356 
00357 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
00358 
00359 #define FT_LOCAL( x )      static  x
00360 #define FT_LOCAL_DEF( x )  static  x
00361 
00362 #else
00363 
00364 #ifdef __cplusplus
00365 #define FT_LOCAL( x )      extern "C"  x
00366 #define FT_LOCAL_DEF( x )  extern "C"  x
00367 #else
00368 #define FT_LOCAL( x )      extern  x
00369 #define FT_LOCAL_DEF( x )  x
00370 #endif
00371 
00372 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
00373 
00374 
00375 #ifndef FT_BASE
00376 
00377 #ifdef __cplusplus
00378 #define FT_BASE( x )  extern "C"  x
00379 #else
00380 #define FT_BASE( x )  extern  x
00381 #endif
00382 
00383 #endif /* !FT_BASE */
00384 
00385 
00386 #ifndef FT_BASE_DEF
00387 
00388 #ifdef __cplusplus
00389 #define FT_BASE_DEF( x )  x
00390 #else
00391 #define FT_BASE_DEF( x )  x
00392 #endif
00393 
00394 #endif /* !FT_BASE_DEF */
00395 
00396 
00397 #ifndef FT_EXPORT
00398 
00399 #ifdef __cplusplus
00400 #define FT_EXPORT( x )  extern "C"  x
00401 #else
00402 #define FT_EXPORT( x )  extern  x
00403 #endif
00404 
00405 #endif /* !FT_EXPORT */
00406 
00407 
00408 #ifndef FT_EXPORT_DEF
00409 
00410 #ifdef __cplusplus
00411 #define FT_EXPORT_DEF( x )  extern "C"  x
00412 #else
00413 #define FT_EXPORT_DEF( x )  extern  x
00414 #endif
00415 
00416 #endif /* !FT_EXPORT_DEF */
00417 
00418 
00419 #ifndef FT_EXPORT_VAR
00420 
00421 #ifdef __cplusplus
00422 #define FT_EXPORT_VAR( x )  extern "C"  x
00423 #else
00424 #define FT_EXPORT_VAR( x )  extern  x
00425 #endif
00426 
00427 #endif /* !FT_EXPORT_VAR */
00428 
00429   /* The following macros are needed to compile the library with a   */
00430   /* C++ compiler and with 16bit compilers.                          */
00431   /*                                                                 */
00432 
00433   /* This is special.  Within C++, you must specify `extern "C"' for */
00434   /* functions which are used via function pointers, and you also    */
00435   /* must do that for structures which contain function pointers to  */
00436   /* assure C linkage -- it's not possible to have (local) anonymous */
00437   /* functions which are accessed by (global) function pointers.     */
00438   /*                                                                 */
00439   /*                                                                 */
00440   /* FT_CALLBACK_DEF is used to _define_ a callback function.        */
00441   /*                                                                 */
00442   /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
00443   /* contains pointers to callback functions.                        */
00444   /*                                                                 */
00445   /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */
00446   /* that contains pointers to callback functions.                   */
00447   /*                                                                 */
00448   /*                                                                 */
00449   /* Some 16bit compilers have to redefine these macros to insert    */
00450   /* the infamous `_cdecl' or `__fastcall' declarations.             */
00451   /*                                                                 */
00452 #ifndef FT_CALLBACK_DEF
00453 #ifdef __cplusplus
00454 #define FT_CALLBACK_DEF( x )  extern "C"  x
00455 #else
00456 #define FT_CALLBACK_DEF( x )  static  x
00457 #endif
00458 #endif /* FT_CALLBACK_DEF */
00459 
00460 #ifndef FT_CALLBACK_TABLE
00461 #ifdef __cplusplus
00462 #define FT_CALLBACK_TABLE      extern "C"
00463 #define FT_CALLBACK_TABLE_DEF  extern "C"
00464 #else
00465 #define FT_CALLBACK_TABLE      extern
00466 #define FT_CALLBACK_TABLE_DEF  /* nothing */
00467 #endif
00468 #endif /* FT_CALLBACK_TABLE */
00469 
00470 
00471 FT_END_HEADER
00472 
00473 
00474 #endif /* __FTCONFIG_H__ */
00475 
00476 
00477 /* END */

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