00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
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
00052
00053
00054
00055
00056
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
00067
00068
00069
00070
00071
00072
00073
00074 #ifndef FT_CHAR_BIT
00075 #define FT_CHAR_BIT CHAR_BIT
00076 #endif
00077
00078
00079
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
00088
00089
00090
00091
00092
00093
00094
00095
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
00107
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
00119
00120
00121
00122 #define FT_ALIGNMENT 8
00123
00124
00125
00126
00127 #ifndef FT_UNUSED
00128 #define FT_UNUSED( arg ) ( (arg) = (arg) )
00129 #endif
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 #if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
00151 ( defined( __MWERKS__ ) && defined( macintosh ) )
00152
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
00163 #include "ConditionalMacros.h"
00164 #if TARGET_OS_MAC
00165 #define FT_MACINTOSH 1
00166 #endif
00167
00168 #endif
00169
00170
00171
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
00182
00183
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
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
00218
00219 #if FT_SIZEOF_LONG == 8
00220
00221
00222 #define FT_LONG64
00223 #define FT_INT64 long
00224
00225 #elif defined( _MSC_VER ) && _MSC_VER >= 900
00226
00227
00228 #define FT_LONG64
00229 #define FT_INT64 __int64
00230
00231 #elif defined( __BORLANDC__ )
00232
00233
00234
00235
00236
00237 #define FT_LONG64
00238 #define FT_INT64 __int64
00239
00240 #elif defined( __WATCOMC__ )
00241
00242
00243
00244 #elif defined( __MWERKS__ )
00245
00246 #define FT_LONG64
00247 #define FT_INT64 long long int
00248
00249 #elif defined( __GNUC__ )
00250
00251
00252 #define FT_LONG64
00253 #define FT_INT64 long long int
00254
00255 #endif
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265 #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
00266
00267 #ifdef __STDC__
00268
00269
00270
00271
00272
00273 #undef FT_LONG64
00274 #undef FT_INT64
00275
00276 #endif
00277
00278 #endif
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
00288
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"
00304 "mov %0, %2, asr #31\n\t"
00305 "add %0, %0, #0x8000\n\t"
00306 "adds %1, %1, %0\n\t"
00307 "adc %2, %2, #0\n\t"
00308 "mov %0, %1, lsr #16\n\t"
00309 "orr %0, %0, %2, lsl #16\n\t"
00310 : "=r"(a), "=&r"(t2), "=&r"(t)
00311 : "r"(a), "r"(b) );
00312 return a;
00313 }
00314
00315 #endif
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
00344
00345 #endif
00346
00347 #endif
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
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
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
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
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
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
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
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
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
00467 #endif
00468 #endif
00469
00470
00471 FT_END_HEADER
00472
00473
00474 #endif
00475
00476
00477