| OLD | NEW |
| 1 /* ftconfig.h. Generated from ftconfig.in by configure. */ | 1 /* ftconfig.h. Generated from ftconfig.in by configure. */ |
| 2 /***************************************************************************/ | 2 /***************************************************************************/ |
| 3 /* */ | 3 /* */ |
| 4 /* ftconfig.in */ | 4 /* ftconfig.in */ |
| 5 /* */ | 5 /* */ |
| 6 /* UNIX-specific configuration file (specification only). */ | 6 /* UNIX-specific configuration file (specification only). */ |
| 7 /* */ | 7 /* */ |
| 8 /* Copyright 1996-2004, 2006-2009, 2011 by */ | 8 /* Copyright 1996-2015 by */ |
| 9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
| 10 /* */ | 10 /* */ |
| 11 /* This file is part of the FreeType project, and may only be used, */ | 11 /* This file is part of the FreeType project, and may only be used, */ |
| 12 /* modified, and distributed under the terms of the FreeType project */ | 12 /* modified, and distributed under the terms of the FreeType project */ |
| 13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
| 14 /* this file you indicate that you have read the license and */ | 14 /* this file you indicate that you have read the license and */ |
| 15 /* understand and accept it fully. */ | 15 /* understand and accept it fully. */ |
| 16 /* */ | 16 /* */ |
| 17 /***************************************************************************/ | 17 /***************************************************************************/ |
| 18 | 18 |
| 19 | 19 |
| 20 /*************************************************************************/ | 20 /*************************************************************************/ |
| 21 /* */ | 21 /* */ |
| 22 /* This header file contains a number of macro definitions that are used */ | 22 /* This header file contains a number of macro definitions that are used */ |
| 23 /* by the rest of the engine. Most of the macros here are automatically */ | 23 /* by the rest of the engine. Most of the macros here are automatically */ |
| 24 /* determined at compile time, and you should not need to change it to */ | 24 /* determined at compile time, and you should not need to change it to */ |
| 25 /* port FreeType, except to compile the library with a non-ANSI */ | 25 /* port FreeType, except to compile the library with a non-ANSI */ |
| 26 /* compiler. */ | 26 /* compiler. */ |
| 27 /* */ | 27 /* */ |
| 28 /* Note however that if some specific modifications are needed, we */ | 28 /* Note however that if some specific modifications are needed, we */ |
| 29 /* advise you to place a modified copy in your build directory. */ | 29 /* advise you to place a modified copy in your build directory. */ |
| 30 /* */ | 30 /* */ |
| 31 /* The build directory is usually `freetype/builds/<system>', and */ | 31 /* The build directory is usually `builds/<system>', and contains */ |
| 32 /* contains system-specific files that are always included first when */ | 32 /* system-specific files that are always included first when building */ |
| 33 /* building the library. */ | 33 /* the library. */ |
| 34 /* */ | 34 /* */ |
| 35 /*************************************************************************/ | 35 /*************************************************************************/ |
| 36 | 36 |
| 37 | 37 |
| 38 #ifndef __FTCONFIG_H__ | 38 #ifndef __FTCONFIG_H__ |
| 39 #define __FTCONFIG_H__ | 39 #define __FTCONFIG_H__ |
| 40 | 40 |
| 41 #include <ft2build.h> | 41 #include <ft2build.h> |
| 42 #include FT_CONFIG_OPTIONS_H | 42 #include FT_CONFIG_OPTIONS_H |
| 43 #include FT_CONFIG_STANDARD_LIBRARY_H | 43 #include FT_CONFIG_STANDARD_LIBRARY_H |
| 44 | 44 |
| 45 | 45 |
| 46 FT_BEGIN_HEADER | 46 FT_BEGIN_HEADER |
| 47 | 47 |
| 48 | 48 |
| 49 /*************************************************************************/ | 49 /*************************************************************************/ |
| 50 /* */ | 50 /* */ |
| 51 /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ | 51 /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ |
| 52 /* */ | 52 /* */ |
| 53 /* These macros can be toggled to suit a specific system. The current */ | 53 /* These macros can be toggled to suit a specific system. The current */ |
| 54 /* ones are defaults used to compile FreeType in an ANSI C environment */ | 54 /* ones are defaults used to compile FreeType in an ANSI C environment */ |
| 55 /* (16bit compilers are also supported). Copy this file to your own */ | 55 /* (16bit compilers are also supported). Copy this file to your own */ |
| 56 /* `freetype/builds/<system>' directory, and edit it to port the engine. */ | 56 /* `builds/<system>' directory, and edit it to port the engine. */ |
| 57 /* */ | 57 /* */ |
| 58 /*************************************************************************/ | 58 /*************************************************************************/ |
| 59 | 59 |
| 60 | 60 |
| 61 #define HAVE_UNISTD_H 1 | 61 #define HAVE_UNISTD_H 1 |
| 62 #define HAVE_FCNTL_H 1 | 62 #define HAVE_FCNTL_H 1 |
| 63 #define HAVE_STDINT_H 1 | 63 #define HAVE_STDINT_H 1 |
| 64 | 64 |
| 65 | 65 |
| 66 /* There are systems (like the Texas Instruments 'C54x) where a `char' */ | 66 /* There are systems (like the Texas Instruments 'C54x) where a `char' */ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 83 #define SIZEOF_LONG 8 | 83 #define SIZEOF_LONG 8 |
| 84 #define FT_SIZEOF_INT SIZEOF_INT | 84 #define FT_SIZEOF_INT SIZEOF_INT |
| 85 #define FT_SIZEOF_LONG SIZEOF_LONG | 85 #define FT_SIZEOF_LONG SIZEOF_LONG |
| 86 | 86 |
| 87 #else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ | 87 #else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */ |
| 88 | 88 |
| 89 /* Following cpp computation of the bit length of int and long */ | 89 /* Following cpp computation of the bit length of int and long */ |
| 90 /* is copied from default include/freetype/config/ftconfig.h. */ | 90 /* is copied from default include/freetype/config/ftconfig.h. */ |
| 91 /* If any improvement is required for this file, it should be */ | 91 /* If any improvement is required for this file, it should be */ |
| 92 /* applied to the original header file for the builders that */ | 92 /* applied to the original header file for the builders that */ |
| 93 /* does not use configure script. */ | 93 /* do not use configure script. */ |
| 94 | 94 |
| 95 /* The size of an `int' type. */ | 95 /* The size of an `int' type. */ |
| 96 #if FT_UINT_MAX == 0xFFFFUL | 96 #if FT_UINT_MAX == 0xFFFFUL |
| 97 #define FT_SIZEOF_INT (16 / FT_CHAR_BIT) | 97 #define FT_SIZEOF_INT (16 / FT_CHAR_BIT) |
| 98 #elif FT_UINT_MAX == 0xFFFFFFFFUL | 98 #elif FT_UINT_MAX == 0xFFFFFFFFUL |
| 99 #define FT_SIZEOF_INT (32 / FT_CHAR_BIT) | 99 #define FT_SIZEOF_INT (32 / FT_CHAR_BIT) |
| 100 #elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL | 100 #elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL |
| 101 #define FT_SIZEOF_INT (64 / FT_CHAR_BIT) | 101 #define FT_SIZEOF_INT (64 / FT_CHAR_BIT) |
| 102 #else | 102 #else |
| 103 #error "Unsupported size of `int' type!" | 103 #error "Unsupported size of `int' type!" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 /*************************************************************************/ | 136 /*************************************************************************/ |
| 137 | 137 |
| 138 | 138 |
| 139 /*************************************************************************/ | 139 /*************************************************************************/ |
| 140 /* */ | 140 /* */ |
| 141 /* Mac support */ | 141 /* Mac support */ |
| 142 /* */ | 142 /* */ |
| 143 /* This is the only necessary change, so it is defined here instead */ | 143 /* This is the only necessary change, so it is defined here instead */ |
| 144 /* providing a new configuration file. */ | 144 /* providing a new configuration file. */ |
| 145 /* */ | 145 /* */ |
| 146 #if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ | 146 #if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) ) |
| 147 ( defined( __MWERKS__ ) && defined( macintosh ) ) | |
| 148 /* no Carbon frameworks for 64bit 10.4.x */ | 147 /* no Carbon frameworks for 64bit 10.4.x */ |
| 149 /* AvailabilityMacros.h is available since Mac OS X 10.2, */ | 148 /* AvailabilityMacros.h is available since Mac OS X 10.2, */ |
| 150 /* so guess the system version by maximum errno before inclusion */ | 149 /* so guess the system version by maximum errno before inclusion */ |
| 151 #include <errno.h> | 150 #include <errno.h> |
| 152 #ifdef ECANCELED /* defined since 10.2 */ | 151 #ifdef ECANCELED /* defined since 10.2 */ |
| 153 #include "AvailabilityMacros.h" | 152 #include "AvailabilityMacros.h" |
| 154 #endif | 153 #endif |
| 155 #if defined( __LP64__ ) && \ | 154 #if defined( __LP64__ ) && \ |
| 156 ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) | 155 ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) |
| 157 #define DARWIN_NO_CARBON 1 | 156 #undef FT_MACINTOSH |
| 158 #else | |
| 159 #define FT_MACINTOSH 1 | |
| 160 #endif | 157 #endif |
| 161 | 158 |
| 162 #elif defined( __SC__ ) || defined( __MRC__ ) | 159 #elif defined( __SC__ ) || defined( __MRC__ ) |
| 163 /* Classic MacOS compilers */ | 160 /* Classic MacOS compilers */ |
| 164 #include "ConditionalMacros.h" | 161 #include "ConditionalMacros.h" |
| 165 #if TARGET_OS_MAC | 162 #if TARGET_OS_MAC |
| 166 #define FT_MACINTOSH 1 | 163 #define FT_MACINTOSH 1 |
| 167 #endif | 164 #endif |
| 168 | 165 |
| 169 #endif | 166 #endif |
| 170 | 167 |
| 171 | 168 |
| 172 /* Fix compiler warning with sgi compiler */ | 169 /* Fix compiler warning with sgi compiler */ |
| 173 #if defined( __sgi ) && !defined( __GNUC__ ) | 170 #if defined( __sgi ) && !defined( __GNUC__ ) |
| 174 #if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 ) | 171 #if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 ) |
| 175 #pragma set woff 3505 | 172 #pragma set woff 3505 |
| 176 #endif | 173 #endif |
| 177 #endif | 174 #endif |
| 178 | 175 |
| 179 | 176 |
| 180 /*************************************************************************/ | 177 /*************************************************************************/ |
| 181 /* */ | 178 /* */ |
| 182 /* IntN types */ | 179 /* <Section> */ |
| 180 /* basic_types */ |
| 183 /* */ | 181 /* */ |
| 184 /* Used to guarantee the size of some specific integers. */ | 182 /*************************************************************************/ |
| 183 |
| 184 |
| 185 /*************************************************************************/ |
| 185 /* */ | 186 /* */ |
| 186 typedef signed short FT_Int16; | 187 /* <Type> */ |
| 188 /* FT_Int16 */ |
| 189 /* */ |
| 190 /* <Description> */ |
| 191 /* A typedef for a 16bit signed integer type. */ |
| 192 /* */ |
| 193 typedef signed short FT_Int16; |
| 194 |
| 195 |
| 196 /*************************************************************************/ |
| 197 /* */ |
| 198 /* <Type> */ |
| 199 /* FT_UInt16 */ |
| 200 /* */ |
| 201 /* <Description> */ |
| 202 /* A typedef for a 16bit unsigned integer type. */ |
| 203 /* */ |
| 187 typedef unsigned short FT_UInt16; | 204 typedef unsigned short FT_UInt16; |
| 188 | 205 |
| 206 /* */ |
| 207 |
| 208 |
| 209 /* this #if 0 ... #endif clause is for documentation purposes */ |
| 210 #if 0 |
| 211 |
| 212 /*************************************************************************/ |
| 213 /* */ |
| 214 /* <Type> */ |
| 215 /* FT_Int32 */ |
| 216 /* */ |
| 217 /* <Description> */ |
| 218 /* A typedef for a 32bit signed integer type. The size depends on */ |
| 219 /* the configuration. */ |
| 220 /* */ |
| 221 typedef signed XXX FT_Int32; |
| 222 |
| 223 |
| 224 /*************************************************************************/ |
| 225 /* */ |
| 226 /* <Type> */ |
| 227 /* FT_UInt32 */ |
| 228 /* */ |
| 229 /* A typedef for a 32bit unsigned integer type. The size depends on */ |
| 230 /* the configuration. */ |
| 231 /* */ |
| 232 typedef unsigned XXX FT_UInt32; |
| 233 |
| 234 |
| 235 /*************************************************************************/ |
| 236 /* */ |
| 237 /* <Type> */ |
| 238 /* FT_Int64 */ |
| 239 /* */ |
| 240 /* A typedef for a 64bit signed integer type. The size depends on */ |
| 241 /* the configuration. Only defined if there is real 64bit support; */ |
| 242 /* otherwise, it gets emulated with a structure (if necessary). */ |
| 243 /* */ |
| 244 typedef signed XXX FT_Int64; |
| 245 |
| 246 |
| 247 /*************************************************************************/ |
| 248 /* */ |
| 249 /* <Type> */ |
| 250 /* FT_UInt64 */ |
| 251 /* */ |
| 252 /* A typedef for a 64bit unsigned integer type. The size depends on */ |
| 253 /* the configuration. Only defined if there is real 64bit support; */ |
| 254 /* otherwise, it gets emulated with a structure (if necessary). */ |
| 255 /* */ |
| 256 typedef unsigned XXX FT_UInt64; |
| 257 |
| 258 /* */ |
| 259 |
| 260 #endif |
| 261 |
| 189 #if FT_SIZEOF_INT == 4 | 262 #if FT_SIZEOF_INT == 4 |
| 190 | 263 |
| 191 typedef signed int FT_Int32; | 264 typedef signed int FT_Int32; |
| 192 typedef unsigned int FT_UInt32; | 265 typedef unsigned int FT_UInt32; |
| 193 | 266 |
| 194 #elif FT_SIZEOF_LONG == 4 | 267 #elif FT_SIZEOF_LONG == 4 |
| 195 | 268 |
| 196 typedef signed long FT_Int32; | 269 typedef signed long FT_Int32; |
| 197 typedef unsigned long FT_UInt32; | 270 typedef unsigned long FT_UInt32; |
| 198 | 271 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 214 | 287 |
| 215 #endif | 288 #endif |
| 216 | 289 |
| 217 | 290 |
| 218 /* determine whether we have a 64-bit int type for platforms without */ | 291 /* determine whether we have a 64-bit int type for platforms without */ |
| 219 /* Autoconf */ | 292 /* Autoconf */ |
| 220 #if FT_SIZEOF_LONG == 8 | 293 #if FT_SIZEOF_LONG == 8 |
| 221 | 294 |
| 222 /* FT_LONG64 must be defined if a 64-bit type is available */ | 295 /* FT_LONG64 must be defined if a 64-bit type is available */ |
| 223 #define FT_LONG64 | 296 #define FT_LONG64 |
| 224 #define FT_INT64 long | 297 #define FT_INT64 long |
| 298 #define FT_UINT64 unsigned long |
| 225 | 299 |
| 226 #elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ | 300 /*************************************************************************/ |
| 301 /* */ |
| 302 /* A 64-bit data type may create compilation problems if you compile */ |
| 303 /* in strict ANSI mode. To avoid them, we disable other 64-bit data */ |
| 304 /* types if __STDC__ is defined. You can however ignore this rule */ |
| 305 /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ |
| 306 /* */ |
| 307 #elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 ) |
| 308 |
| 309 #if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ |
| 227 | 310 |
| 228 /* this compiler provides the __int64 type */ | 311 /* this compiler provides the __int64 type */ |
| 229 #define FT_LONG64 | 312 #define FT_LONG64 |
| 230 #define FT_INT64 __int64 | 313 #define FT_INT64 __int64 |
| 314 #define FT_UINT64 unsigned __int64 |
| 231 | 315 |
| 232 #elif defined( __BORLANDC__ ) /* Borland C++ */ | 316 #elif defined( __BORLANDC__ ) /* Borland C++ */ |
| 233 | 317 |
| 234 /* XXXX: We should probably check the value of __BORLANDC__ in order */ | 318 /* XXXX: We should probably check the value of __BORLANDC__ in order */ |
| 235 /* to test the compiler version. */ | 319 /* to test the compiler version. */ |
| 236 | 320 |
| 237 /* this compiler provides the __int64 type */ | 321 /* this compiler provides the __int64 type */ |
| 238 #define FT_LONG64 | 322 #define FT_LONG64 |
| 239 #define FT_INT64 __int64 | 323 #define FT_INT64 __int64 |
| 324 #define FT_UINT64 unsigned __int64 |
| 240 | 325 |
| 241 #elif defined( __WATCOMC__ ) /* Watcom C++ */ | 326 #elif defined( __WATCOMC__ ) /* Watcom C++ */ |
| 242 | 327 |
| 243 /* Watcom doesn't provide 64-bit data types */ | 328 /* Watcom doesn't provide 64-bit data types */ |
| 244 | 329 |
| 245 #elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ | 330 #elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ |
| 246 | 331 |
| 247 #define FT_LONG64 | 332 #define FT_LONG64 |
| 248 #define FT_INT64 long long int | 333 #define FT_INT64 long long int |
| 334 #define FT_UINT64 unsigned long long int |
| 249 | 335 |
| 250 #elif defined( __GNUC__ ) | 336 #elif defined( __GNUC__ ) |
| 251 | 337 |
| 252 /* GCC provides the `long long' type */ | 338 /* GCC provides the `long long' type */ |
| 253 #define FT_LONG64 | 339 #define FT_LONG64 |
| 254 #define FT_INT64 long long int | 340 #define FT_INT64 long long int |
| 341 #define FT_UINT64 unsigned long long int |
| 342 |
| 343 #endif /* _MSC_VER */ |
| 255 | 344 |
| 256 #endif /* FT_SIZEOF_LONG == 8 */ | 345 #endif /* FT_SIZEOF_LONG == 8 */ |
| 257 | 346 |
| 347 #ifdef FT_LONG64 |
| 348 typedef FT_INT64 FT_Int64; |
| 349 typedef FT_UINT64 FT_UInt64; |
| 350 #endif |
| 351 |
| 258 | 352 |
| 259 /*************************************************************************/ | 353 /*************************************************************************/ |
| 260 /* */ | 354 /* */ |
| 261 /* A 64-bit data type will create compilation problems if you compile */ | 355 /* miscellaneous */ |
| 262 /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */ | |
| 263 /* is defined. You can however ignore this rule by defining the */ | |
| 264 /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ | |
| 265 /* */ | 356 /* */ |
| 266 #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) | 357 /*************************************************************************/ |
| 267 | |
| 268 #ifdef __STDC__ | |
| 269 | |
| 270 /* Undefine the 64-bit macros in strict ANSI compilation mode. */ | |
| 271 /* Since `#undef' doesn't survive in configuration header files */ | |
| 272 /* we use the postprocessing facility of AC_CONFIG_HEADERS to */ | |
| 273 /* replace the leading `/' with `#'. */ | |
| 274 #undef FT_LONG64 | |
| 275 #undef FT_INT64 | |
| 276 | |
| 277 #endif /* __STDC__ */ | |
| 278 | |
| 279 #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ | |
| 280 | 358 |
| 281 | 359 |
| 282 #define FT_BEGIN_STMNT do { | 360 #define FT_BEGIN_STMNT do { |
| 283 #define FT_END_STMNT } while ( 0 ) | 361 #define FT_END_STMNT } while ( 0 ) |
| 284 #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT | 362 #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT |
| 285 | 363 |
| 286 | 364 |
| 287 #ifndef FT_CONFIG_OPTION_NO_ASSEMBLER | 365 /* typeof condition taken from gnulib's `intprops.h' header file */ |
| 288 /* Provide assembler fragments for performance-critical functions. */ | 366 #if ( __GNUC__ >= 2 || \ |
| 289 /* These must be defined `static __inline__' with GCC. */ | 367 defined( __IBM__TYPEOF__ ) || \ |
| 290 | 368 ( __SUNPRO_C >= 0x5110 && !__STDC__ ) ) |
| 291 #if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ | 369 #define FT_TYPEOF( type ) (__typeof__ (type)) |
| 292 #define FT_MULFIX_ASSEMBLER FT_MulFix_arm | 370 #else |
| 293 | 371 #define FT_TYPEOF( type ) /* empty */ |
| 294 /* documentation is in freetype.h */ | |
| 295 | |
| 296 static __inline FT_Int32 | |
| 297 FT_MulFix_arm( FT_Int32 a, | |
| 298 FT_Int32 b ) | |
| 299 { | |
| 300 register FT_Int32 t, t2; | |
| 301 | |
| 302 | |
| 303 __asm | |
| 304 { | |
| 305 smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ | |
| 306 mov a, t, asr #31 /* a = (hi >> 31) */ | |
| 307 add a, a, #0x8000 /* a += 0x8000 */ | |
| 308 adds t2, t2, a /* t2 += a */ | |
| 309 adc t, t, #0 /* t += carry */ | |
| 310 mov a, t2, lsr #16 /* a = t2 >> 16 */ | |
| 311 orr a, a, t, lsl #16 /* a |= t << 16 */ | |
| 312 } | |
| 313 return a; | |
| 314 } | |
| 315 | |
| 316 #endif /* __CC_ARM || __ARMCC__ */ | |
| 317 | |
| 318 | |
| 319 #ifdef __GNUC__ | |
| 320 | |
| 321 #if defined( __arm__ ) && !defined( __thumb__ ) && \ | |
| 322 !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) | |
| 323 #define FT_MULFIX_ASSEMBLER FT_MulFix_arm | |
| 324 | |
| 325 /* documentation is in freetype.h */ | |
| 326 | |
| 327 static __inline__ FT_Int32 | |
| 328 FT_MulFix_arm( FT_Int32 a, | |
| 329 FT_Int32 b ) | |
| 330 { | |
| 331 register FT_Int32 t, t2; | |
| 332 | |
| 333 | |
| 334 __asm__ __volatile__ ( | |
| 335 "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ | |
| 336 "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ | |
| 337 "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ | |
| 338 "adds %1, %1, %0\n\t" /* %1 += %0 */ | |
| 339 "adc %2, %2, #0\n\t" /* %2 += carry */ | |
| 340 "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ | |
| 341 "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ | |
| 342 : "=r"(a), "=&r"(t2), "=&r"(t) | |
| 343 : "r"(a), "r"(b) ); | |
| 344 return a; | |
| 345 } | |
| 346 | |
| 347 #endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */ | |
| 348 | |
| 349 #if defined( __i386__ ) | |
| 350 #define FT_MULFIX_ASSEMBLER FT_MulFix_i386 | |
| 351 | |
| 352 /* documentation is in freetype.h */ | |
| 353 | |
| 354 static __inline__ FT_Int32 | |
| 355 FT_MulFix_i386( FT_Int32 a, | |
| 356 FT_Int32 b ) | |
| 357 { | |
| 358 register FT_Int32 result; | |
| 359 | |
| 360 | |
| 361 __asm__ __volatile__ ( | |
| 362 "imul %%edx\n" | |
| 363 "movl %%edx, %%ecx\n" | |
| 364 "sarl $31, %%ecx\n" | |
| 365 "addl $0x8000, %%ecx\n" | |
| 366 "addl %%ecx, %%eax\n" | |
| 367 "adcl $0, %%edx\n" | |
| 368 "shrl $16, %%eax\n" | |
| 369 "shll $16, %%edx\n" | |
| 370 "addl %%edx, %%eax\n" | |
| 371 : "=a"(result), "=d"(b) | |
| 372 : "a"(a), "d"(b) | |
| 373 : "%ecx", "cc" ); | |
| 374 return result; | |
| 375 } | |
| 376 | |
| 377 #endif /* i386 */ | |
| 378 | |
| 379 #endif /* __GNUC__ */ | |
| 380 | |
| 381 | |
| 382 #ifdef _MSC_VER /* Visual C++ */ | |
| 383 | |
| 384 #ifdef _M_IX86 | |
| 385 | |
| 386 #define FT_MULFIX_ASSEMBLER FT_MulFix_i386 | |
| 387 | |
| 388 /* documentation is in freetype.h */ | |
| 389 | |
| 390 static __inline FT_Int32 | |
| 391 FT_MulFix_i386( FT_Int32 a, | |
| 392 FT_Int32 b ) | |
| 393 { | |
| 394 register FT_Int32 result; | |
| 395 | |
| 396 __asm | |
| 397 { | |
| 398 mov eax, a | |
| 399 mov edx, b | |
| 400 imul edx | |
| 401 mov ecx, edx | |
| 402 sar ecx, 31 | |
| 403 add ecx, 8000h | |
| 404 add eax, ecx | |
| 405 adc edx, 0 | |
| 406 shr eax, 16 | |
| 407 shl edx, 16 | |
| 408 add eax, edx | |
| 409 mov result, eax | |
| 410 } | |
| 411 return result; | |
| 412 } | |
| 413 | |
| 414 #endif /* _M_IX86 */ | |
| 415 | |
| 416 #endif /* _MSC_VER */ | |
| 417 | |
| 418 #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ | |
| 419 | |
| 420 | |
| 421 #ifdef FT_CONFIG_OPTION_INLINE_MULFIX | |
| 422 #ifdef FT_MULFIX_ASSEMBLER | |
| 423 #define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER | |
| 424 #endif | |
| 425 #endif | 372 #endif |
| 426 | 373 |
| 427 | 374 |
| 428 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT | 375 #ifdef FT_MAKE_OPTION_SINGLE_OBJECT |
| 429 | 376 |
| 430 #define FT_LOCAL( x ) static x | 377 #define FT_LOCAL( x ) static x |
| 431 #define FT_LOCAL_DEF( x ) static x | 378 #define FT_LOCAL_DEF( x ) static x |
| 432 | 379 |
| 433 #else | 380 #else |
| 434 | 381 |
| 435 #ifdef __cplusplus | 382 #ifdef __cplusplus |
| 436 #define FT_LOCAL( x ) extern "C" x | 383 #define FT_LOCAL( x ) extern "C" x |
| 437 #define FT_LOCAL_DEF( x ) extern "C" x | 384 #define FT_LOCAL_DEF( x ) extern "C" x |
| 438 #else | 385 #else |
| 439 #define FT_LOCAL( x ) extern x | 386 #define FT_LOCAL( x ) extern x |
| 440 #define FT_LOCAL_DEF( x ) x | 387 #define FT_LOCAL_DEF( x ) x |
| 441 #endif | 388 #endif |
| 442 | 389 |
| 443 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ | 390 #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ |
| 444 | 391 |
| 392 #define FT_LOCAL_ARRAY( x ) extern const x |
| 393 #define FT_LOCAL_ARRAY_DEF( x ) const x |
| 394 |
| 445 | 395 |
| 446 #ifndef FT_BASE | 396 #ifndef FT_BASE |
| 447 | 397 |
| 448 #ifdef __cplusplus | 398 #ifdef __cplusplus |
| 449 #define FT_BASE( x ) extern "C" x | 399 #define FT_BASE( x ) extern "C" x |
| 450 #else | 400 #else |
| 451 #define FT_BASE( x ) extern x | 401 #define FT_BASE( x ) extern x |
| 452 #endif | 402 #endif |
| 453 | 403 |
| 454 #endif /* !FT_BASE */ | 404 #endif /* !FT_BASE */ |
| 455 | 405 |
| 456 | 406 |
| 457 #ifndef FT_BASE_DEF | 407 #ifndef FT_BASE_DEF |
| 458 | 408 |
| 459 #ifdef __cplusplus | 409 #ifdef __cplusplus |
| 460 #define FT_BASE_DEF( x ) x | 410 #define FT_BASE_DEF( x ) x |
| 461 #else | 411 #else |
| 462 #define FT_BASE_DEF( x ) x | 412 #define FT_BASE_DEF( x ) x |
| 463 #endif | 413 #endif |
| 464 | 414 |
| 465 #endif /* !FT_BASE_DEF */ | 415 #endif /* !FT_BASE_DEF */ |
| 466 | 416 |
| 467 | 417 |
| 468 #ifndef FT_EXPORT | 418 #ifndef FT_EXPORT |
| 469 | 419 |
| 470 #ifdef __cplusplus | 420 #ifdef __cplusplus |
| 471 #define FT_EXPORT( x ) __attribute__((visibility("default"))) extern "C" x | 421 #define FT_EXPORT( x ) extern "C" x |
| 472 #else | 422 #else |
| 473 #define FT_EXPORT( x ) __attribute__((visibility("default"))) extern x | 423 #define FT_EXPORT( x ) extern x |
| 474 #endif | 424 #endif |
| 475 | 425 |
| 476 #endif /* !FT_EXPORT */ | 426 #endif /* !FT_EXPORT */ |
| 477 | 427 |
| 478 | 428 |
| 479 #ifndef FT_EXPORT_DEF | 429 #ifndef FT_EXPORT_DEF |
| 480 | 430 |
| 481 #ifdef __cplusplus | 431 #ifdef __cplusplus |
| 482 #define FT_EXPORT_DEF( x ) __attribute__((visibility("default"))) extern "C" x | 432 #define FT_EXPORT_DEF( x ) extern "C" x |
| 483 #else | 433 #else |
| 484 #define FT_EXPORT_DEF( x ) __attribute__((visibility("default"))) extern x | 434 #define FT_EXPORT_DEF( x ) extern x |
| 485 #endif | 435 #endif |
| 486 | 436 |
| 487 #endif /* !FT_EXPORT_DEF */ | 437 #endif /* !FT_EXPORT_DEF */ |
| 488 | 438 |
| 489 | 439 |
| 490 #ifndef FT_EXPORT_VAR | 440 #ifndef FT_EXPORT_VAR |
| 491 | 441 |
| 492 #ifdef __cplusplus | 442 #ifdef __cplusplus |
| 493 #define FT_EXPORT_VAR( x ) extern "C" x | 443 #define FT_EXPORT_VAR( x ) extern "C" x |
| 494 #else | 444 #else |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 #endif /* FT_CALLBACK_TABLE */ | 489 #endif /* FT_CALLBACK_TABLE */ |
| 540 | 490 |
| 541 | 491 |
| 542 FT_END_HEADER | 492 FT_END_HEADER |
| 543 | 493 |
| 544 | 494 |
| 545 #endif /* __FTCONFIG_H__ */ | 495 #endif /* __FTCONFIG_H__ */ |
| 546 | 496 |
| 547 | 497 |
| 548 /* END */ | 498 /* END */ |
| OLD | NEW |