vrshoot
diff libs/ft2static/freetype/config/ftconfig.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/ft2static/freetype/config/ftconfig.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,528 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftconfig.h */ 1.7 +/* */ 1.8 +/* ANSI-specific configuration file (specification only). */ 1.9 +/* */ 1.10 +/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2010 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 + /*************************************************************************/ 1.23 + /* */ 1.24 + /* This header file contains a number of macro definitions that are used */ 1.25 + /* by the rest of the engine. Most of the macros here are automatically */ 1.26 + /* determined at compile time, and you should not need to change it to */ 1.27 + /* port FreeType, except to compile the library with a non-ANSI */ 1.28 + /* compiler. */ 1.29 + /* */ 1.30 + /* Note however that if some specific modifications are needed, we */ 1.31 + /* advise you to place a modified copy in your build directory. */ 1.32 + /* */ 1.33 + /* The build directory is usually `freetype/builds/<system>', and */ 1.34 + /* contains system-specific files that are always included first when */ 1.35 + /* building the library. */ 1.36 + /* */ 1.37 + /* This ANSI version should stay in `include/freetype/config'. */ 1.38 + /* */ 1.39 + /*************************************************************************/ 1.40 + 1.41 +#ifndef __FTCONFIG_H__ 1.42 +#define __FTCONFIG_H__ 1.43 + 1.44 +#include <ft2build.h> 1.45 +#include FT_CONFIG_OPTIONS_H 1.46 +#include FT_CONFIG_STANDARD_LIBRARY_H 1.47 + 1.48 + 1.49 +FT_BEGIN_HEADER 1.50 + 1.51 + 1.52 + /*************************************************************************/ 1.53 + /* */ 1.54 + /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ 1.55 + /* */ 1.56 + /* These macros can be toggled to suit a specific system. The current */ 1.57 + /* ones are defaults used to compile FreeType in an ANSI C environment */ 1.58 + /* (16bit compilers are also supported). Copy this file to your own */ 1.59 + /* `freetype/builds/<system>' directory, and edit it to port the engine. */ 1.60 + /* */ 1.61 + /*************************************************************************/ 1.62 + 1.63 + 1.64 + /* There are systems (like the Texas Instruments 'C54x) where a `char' */ 1.65 + /* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */ 1.66 + /* `int' has 16 bits also for this system, sizeof(int) gives 1 which */ 1.67 + /* is probably unexpected. */ 1.68 + /* */ 1.69 + /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */ 1.70 + /* `char' type. */ 1.71 + 1.72 +#ifndef FT_CHAR_BIT 1.73 +#define FT_CHAR_BIT CHAR_BIT 1.74 +#endif 1.75 + 1.76 + 1.77 + /* The size of an `int' type. */ 1.78 +#if FT_UINT_MAX == 0xFFFFUL 1.79 +#define FT_SIZEOF_INT (16 / FT_CHAR_BIT) 1.80 +#elif FT_UINT_MAX == 0xFFFFFFFFUL 1.81 +#define FT_SIZEOF_INT (32 / FT_CHAR_BIT) 1.82 +#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL 1.83 +#define FT_SIZEOF_INT (64 / FT_CHAR_BIT) 1.84 +#else 1.85 +#error "Unsupported size of `int' type!" 1.86 +#endif 1.87 + 1.88 + /* The size of a `long' type. A five-byte `long' (as used e.g. on the */ 1.89 + /* DM642) is recognized but avoided. */ 1.90 +#if FT_ULONG_MAX == 0xFFFFFFFFUL 1.91 +#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) 1.92 +#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL 1.93 +#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) 1.94 +#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL 1.95 +#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT) 1.96 +#else 1.97 +#error "Unsupported size of `long' type!" 1.98 +#endif 1.99 + 1.100 + 1.101 + /* Preferred alignment of data */ 1.102 +#define FT_ALIGNMENT 8 1.103 + 1.104 + 1.105 + /* FT_UNUSED is a macro used to indicate that a given parameter is not */ 1.106 + /* used -- this is only used to get rid of unpleasant compiler warnings */ 1.107 +#ifndef FT_UNUSED 1.108 +#define FT_UNUSED( arg ) ( (arg) = (arg) ) 1.109 +#endif 1.110 + 1.111 + 1.112 + /*************************************************************************/ 1.113 + /* */ 1.114 + /* AUTOMATIC CONFIGURATION MACROS */ 1.115 + /* */ 1.116 + /* These macros are computed from the ones defined above. Don't touch */ 1.117 + /* their definition, unless you know precisely what you are doing. No */ 1.118 + /* porter should need to mess with them. */ 1.119 + /* */ 1.120 + /*************************************************************************/ 1.121 + 1.122 + 1.123 + /*************************************************************************/ 1.124 + /* */ 1.125 + /* Mac support */ 1.126 + /* */ 1.127 + /* This is the only necessary change, so it is defined here instead */ 1.128 + /* providing a new configuration file. */ 1.129 + /* */ 1.130 +#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ 1.131 + ( defined( __MWERKS__ ) && defined( macintosh ) ) 1.132 + /* no Carbon frameworks for 64bit 10.4.x */ 1.133 +#include "AvailabilityMacros.h" 1.134 +#if defined( __LP64__ ) && \ 1.135 + ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) 1.136 +#define DARWIN_NO_CARBON 1 1.137 +#else 1.138 +#define FT_MACINTOSH 1 1.139 +#endif 1.140 + 1.141 +#elif defined( __SC__ ) || defined( __MRC__ ) 1.142 + /* Classic MacOS compilers */ 1.143 +#include "ConditionalMacros.h" 1.144 +#if TARGET_OS_MAC 1.145 +#define FT_MACINTOSH 1 1.146 +#endif 1.147 + 1.148 +#endif 1.149 + 1.150 + 1.151 + /*************************************************************************/ 1.152 + /* */ 1.153 + /* <Section> */ 1.154 + /* basic_types */ 1.155 + /* */ 1.156 + /*************************************************************************/ 1.157 + 1.158 + 1.159 + /*************************************************************************/ 1.160 + /* */ 1.161 + /* <Type> */ 1.162 + /* FT_Int16 */ 1.163 + /* */ 1.164 + /* <Description> */ 1.165 + /* A typedef for a 16bit signed integer type. */ 1.166 + /* */ 1.167 + typedef signed short FT_Int16; 1.168 + 1.169 + 1.170 + /*************************************************************************/ 1.171 + /* */ 1.172 + /* <Type> */ 1.173 + /* FT_UInt16 */ 1.174 + /* */ 1.175 + /* <Description> */ 1.176 + /* A typedef for a 16bit unsigned integer type. */ 1.177 + /* */ 1.178 + typedef unsigned short FT_UInt16; 1.179 + 1.180 + /* */ 1.181 + 1.182 + 1.183 + /* this #if 0 ... #endif clause is for documentation purposes */ 1.184 +#if 0 1.185 + 1.186 + /*************************************************************************/ 1.187 + /* */ 1.188 + /* <Type> */ 1.189 + /* FT_Int32 */ 1.190 + /* */ 1.191 + /* <Description> */ 1.192 + /* A typedef for a 32bit signed integer type. The size depends on */ 1.193 + /* the configuration. */ 1.194 + /* */ 1.195 + typedef signed XXX FT_Int32; 1.196 + 1.197 + 1.198 + /*************************************************************************/ 1.199 + /* */ 1.200 + /* <Type> */ 1.201 + /* FT_UInt32 */ 1.202 + /* */ 1.203 + /* A typedef for a 32bit unsigned integer type. The size depends on */ 1.204 + /* the configuration. */ 1.205 + /* */ 1.206 + typedef unsigned XXX FT_UInt32; 1.207 + 1.208 + /* */ 1.209 + 1.210 +#endif 1.211 + 1.212 +#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT) 1.213 + 1.214 + typedef signed int FT_Int32; 1.215 + typedef unsigned int FT_UInt32; 1.216 + 1.217 +#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT) 1.218 + 1.219 + typedef signed long FT_Int32; 1.220 + typedef unsigned long FT_UInt32; 1.221 + 1.222 +#else 1.223 +#error "no 32bit type found -- please check your configuration files" 1.224 +#endif 1.225 + 1.226 + 1.227 + /* look up an integer type that is at least 32 bits */ 1.228 +#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT) 1.229 + 1.230 + typedef int FT_Fast; 1.231 + typedef unsigned int FT_UFast; 1.232 + 1.233 +#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT) 1.234 + 1.235 + typedef long FT_Fast; 1.236 + typedef unsigned long FT_UFast; 1.237 + 1.238 +#endif 1.239 + 1.240 + 1.241 + /* determine whether we have a 64-bit int type for platforms without */ 1.242 + /* Autoconf */ 1.243 +#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) 1.244 + 1.245 + /* FT_LONG64 must be defined if a 64-bit type is available */ 1.246 +#define FT_LONG64 1.247 +#define FT_INT64 long 1.248 + 1.249 +#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ 1.250 + 1.251 + /* this compiler provides the __int64 type */ 1.252 +#define FT_LONG64 1.253 +#define FT_INT64 __int64 1.254 + 1.255 +#elif defined( __BORLANDC__ ) /* Borland C++ */ 1.256 + 1.257 + /* XXXX: We should probably check the value of __BORLANDC__ in order */ 1.258 + /* to test the compiler version. */ 1.259 + 1.260 + /* this compiler provides the __int64 type */ 1.261 +#define FT_LONG64 1.262 +#define FT_INT64 __int64 1.263 + 1.264 +#elif defined( __WATCOMC__ ) /* Watcom C++ */ 1.265 + 1.266 + /* Watcom doesn't provide 64-bit data types */ 1.267 + 1.268 +#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ 1.269 + 1.270 +#define FT_LONG64 1.271 +#define FT_INT64 long long int 1.272 + 1.273 +#elif defined( __GNUC__ ) 1.274 + 1.275 + /* GCC provides the `long long' type */ 1.276 +#define FT_LONG64 1.277 +#define FT_INT64 long long int 1.278 + 1.279 +#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ 1.280 + 1.281 + 1.282 + /*************************************************************************/ 1.283 + /* */ 1.284 + /* A 64-bit data type will create compilation problems if you compile */ 1.285 + /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */ 1.286 + /* is defined. You can however ignore this rule by defining the */ 1.287 + /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ 1.288 + /* */ 1.289 +#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) 1.290 + 1.291 +#ifdef __STDC__ 1.292 + 1.293 + /* undefine the 64-bit macros in strict ANSI compilation mode */ 1.294 +#undef FT_LONG64 1.295 +#undef FT_INT64 1.296 + 1.297 +#endif /* __STDC__ */ 1.298 + 1.299 +#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ 1.300 + 1.301 + 1.302 +#define FT_BEGIN_STMNT do { 1.303 +#define FT_END_STMNT } while ( 0 ) 1.304 +#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT 1.305 + 1.306 + 1.307 +#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER 1.308 + /* Provide assembler fragments for performance-critical functions. */ 1.309 + /* These must be defined `static __inline__' with GCC. */ 1.310 + 1.311 +#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ 1.312 +#define FT_MULFIX_ASSEMBLER FT_MulFix_arm 1.313 + 1.314 + /* documentation is in freetype.h */ 1.315 + 1.316 + static __inline FT_Int32 1.317 + FT_MulFix_arm( FT_Int32 a, 1.318 + FT_Int32 b ) 1.319 + { 1.320 + register FT_Int32 t, t2; 1.321 + 1.322 + 1.323 + __asm 1.324 + { 1.325 + smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ 1.326 + mov a, t, asr #31 /* a = (hi >> 31) */ 1.327 + add a, a, #0x8000 /* a += 0x8000 */ 1.328 + adds t2, t2, a /* t2 += a */ 1.329 + adc t, t, #0 /* t += carry */ 1.330 + mov a, t2, lsr #16 /* a = t2 >> 16 */ 1.331 + orr a, a, t, lsl #16 /* a |= t << 16 */ 1.332 + } 1.333 + return a; 1.334 + } 1.335 + 1.336 +#endif /* __CC_ARM || __ARMCC__ */ 1.337 + 1.338 + 1.339 +#ifdef __GNUC__ 1.340 + 1.341 +#if defined( __arm__ ) && !defined( __thumb__ ) && \ 1.342 + !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) 1.343 +#define FT_MULFIX_ASSEMBLER FT_MulFix_arm 1.344 + 1.345 + /* documentation is in freetype.h */ 1.346 + 1.347 + static __inline__ FT_Int32 1.348 + FT_MulFix_arm( FT_Int32 a, 1.349 + FT_Int32 b ) 1.350 + { 1.351 + register FT_Int32 t, t2; 1.352 + 1.353 + 1.354 + __asm__ __volatile__ ( 1.355 + "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ 1.356 + "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ 1.357 + "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ 1.358 + "adds %1, %1, %0\n\t" /* %1 += %0 */ 1.359 + "adc %2, %2, #0\n\t" /* %2 += carry */ 1.360 + "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ 1.361 + "orr %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ 1.362 + : "=r"(a), "=&r"(t2), "=&r"(t) 1.363 + : "r"(a), "r"(b) ); 1.364 + return a; 1.365 + } 1.366 + 1.367 +#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */ 1.368 + 1.369 +#if defined( __i386__ ) 1.370 +#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 1.371 + 1.372 + /* documentation is in freetype.h */ 1.373 + 1.374 + static __inline__ FT_Int32 1.375 + FT_MulFix_i386( FT_Int32 a, 1.376 + FT_Int32 b ) 1.377 + { 1.378 + register FT_Int32 result; 1.379 + 1.380 + 1.381 + __asm__ __volatile__ ( 1.382 + "imul %%edx\n" 1.383 + "movl %%edx, %%ecx\n" 1.384 + "sarl $31, %%ecx\n" 1.385 + "addl $0x8000, %%ecx\n" 1.386 + "addl %%ecx, %%eax\n" 1.387 + "adcl $0, %%edx\n" 1.388 + "shrl $16, %%eax\n" 1.389 + "shll $16, %%edx\n" 1.390 + "addl %%edx, %%eax\n" 1.391 + : "=a"(result), "=d"(b) 1.392 + : "a"(a), "d"(b) 1.393 + : "%ecx", "cc" ); 1.394 + return result; 1.395 + } 1.396 + 1.397 +#endif /* i386 */ 1.398 + 1.399 +#endif /* __GNUC__ */ 1.400 + 1.401 +#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ 1.402 + 1.403 + 1.404 +#ifdef FT_CONFIG_OPTION_INLINE_MULFIX 1.405 +#ifdef FT_MULFIX_ASSEMBLER 1.406 +#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER 1.407 +#endif 1.408 +#endif 1.409 + 1.410 + 1.411 +#ifdef FT_MAKE_OPTION_SINGLE_OBJECT 1.412 + 1.413 +#define FT_LOCAL( x ) static x 1.414 +#define FT_LOCAL_DEF( x ) static x 1.415 + 1.416 +#else 1.417 + 1.418 +#ifdef __cplusplus 1.419 +#define FT_LOCAL( x ) extern "C" x 1.420 +#define FT_LOCAL_DEF( x ) extern "C" x 1.421 +#else 1.422 +#define FT_LOCAL( x ) extern x 1.423 +#define FT_LOCAL_DEF( x ) x 1.424 +#endif 1.425 + 1.426 +#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ 1.427 + 1.428 + 1.429 +#ifndef FT_BASE 1.430 + 1.431 +#ifdef __cplusplus 1.432 +#define FT_BASE( x ) extern "C" x 1.433 +#else 1.434 +#define FT_BASE( x ) extern x 1.435 +#endif 1.436 + 1.437 +#endif /* !FT_BASE */ 1.438 + 1.439 + 1.440 +#ifndef FT_BASE_DEF 1.441 + 1.442 +#ifdef __cplusplus 1.443 +#define FT_BASE_DEF( x ) x 1.444 +#else 1.445 +#define FT_BASE_DEF( x ) x 1.446 +#endif 1.447 + 1.448 +#endif /* !FT_BASE_DEF */ 1.449 + 1.450 + 1.451 +#ifndef FT_EXPORT 1.452 + 1.453 +#ifdef __cplusplus 1.454 +#define FT_EXPORT( x ) extern "C" x 1.455 +#else 1.456 +#define FT_EXPORT( x ) extern x 1.457 +#endif 1.458 + 1.459 +#endif /* !FT_EXPORT */ 1.460 + 1.461 + 1.462 +#ifndef FT_EXPORT_DEF 1.463 + 1.464 +#ifdef __cplusplus 1.465 +#define FT_EXPORT_DEF( x ) extern "C" x 1.466 +#else 1.467 +#define FT_EXPORT_DEF( x ) extern x 1.468 +#endif 1.469 + 1.470 +#endif /* !FT_EXPORT_DEF */ 1.471 + 1.472 + 1.473 +#ifndef FT_EXPORT_VAR 1.474 + 1.475 +#ifdef __cplusplus 1.476 +#define FT_EXPORT_VAR( x ) extern "C" x 1.477 +#else 1.478 +#define FT_EXPORT_VAR( x ) extern x 1.479 +#endif 1.480 + 1.481 +#endif /* !FT_EXPORT_VAR */ 1.482 + 1.483 + /* The following macros are needed to compile the library with a */ 1.484 + /* C++ compiler and with 16bit compilers. */ 1.485 + /* */ 1.486 + 1.487 + /* This is special. Within C++, you must specify `extern "C"' for */ 1.488 + /* functions which are used via function pointers, and you also */ 1.489 + /* must do that for structures which contain function pointers to */ 1.490 + /* assure C linkage -- it's not possible to have (local) anonymous */ 1.491 + /* functions which are accessed by (global) function pointers. */ 1.492 + /* */ 1.493 + /* */ 1.494 + /* FT_CALLBACK_DEF is used to _define_ a callback function. */ 1.495 + /* */ 1.496 + /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */ 1.497 + /* contains pointers to callback functions. */ 1.498 + /* */ 1.499 + /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */ 1.500 + /* that contains pointers to callback functions. */ 1.501 + /* */ 1.502 + /* */ 1.503 + /* Some 16bit compilers have to redefine these macros to insert */ 1.504 + /* the infamous `_cdecl' or `__fastcall' declarations. */ 1.505 + /* */ 1.506 +#ifndef FT_CALLBACK_DEF 1.507 +#ifdef __cplusplus 1.508 +#define FT_CALLBACK_DEF( x ) extern "C" x 1.509 +#else 1.510 +#define FT_CALLBACK_DEF( x ) static x 1.511 +#endif 1.512 +#endif /* FT_CALLBACK_DEF */ 1.513 + 1.514 +#ifndef FT_CALLBACK_TABLE 1.515 +#ifdef __cplusplus 1.516 +#define FT_CALLBACK_TABLE extern "C" 1.517 +#define FT_CALLBACK_TABLE_DEF extern "C" 1.518 +#else 1.519 +#define FT_CALLBACK_TABLE extern 1.520 +#define FT_CALLBACK_TABLE_DEF /* nothing */ 1.521 +#endif 1.522 +#endif /* FT_CALLBACK_TABLE */ 1.523 + 1.524 + 1.525 +FT_END_HEADER 1.526 + 1.527 + 1.528 +#endif /* __FTCONFIG_H__ */ 1.529 + 1.530 + 1.531 +/* END */