4
4
/* */
5
5
/* ANSI-specific configuration file (specification only). */
6
6
/* */
7
- /* Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by */
7
+ /* Copyright 1996-2015 by */
8
8
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
9
9
/* */
10
10
/* This file is part of the FreeType project, and may only be used, */
27
27
/* Note however that if some specific modifications are needed, we */
28
28
/* advise you to place a modified copy in your build directory. */
29
29
/* */
30
- /* The build directory is usually `freetype/ builds/<system>', and */
31
- /* contains system-specific files that are always included first when */
32
- /* building the library. */
30
+ /* The build directory is usually `builds/<system>', and contains */
31
+ /* system-specific files that are always included first when building */
32
+ /* the library. */
33
33
/* */
34
- /* This ANSI version should stay in `include/freetype/ config'. */
34
+ /* This ANSI version should stay in `include/config/'. */
35
35
/* */
36
36
/*************************************************************************/
37
37
@@ -53,7 +53,7 @@ FT_BEGIN_HEADER
53
53
/* These macros can be toggled to suit a specific system. The current */
54
54
/* ones are defaults used to compile FreeType in an ANSI C environment */
55
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
@@ -266,7 +266,16 @@ FT_BEGIN_HEADER
266
266
#define FT_INT64 long
267
267
#define FT_UINT64 unsigned long
268
268
269
- #elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
269
+ /*************************************************************************/
270
+ /* */
271
+ /* A 64-bit data type may create compilation problems if you compile */
272
+ /* in strict ANSI mode. To avoid them, we disable other 64-bit data */
273
+ /* types if __STDC__ is defined. You can however ignore this rule */
274
+ /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
275
+ /* */
276
+ #elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
277
+
278
+ #if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
270
279
271
280
/* this compiler provides the __int64 type */
272
281
#define FT_LONG64
@@ -300,178 +309,35 @@ FT_BEGIN_HEADER
300
309
#define FT_INT64 long long int
301
310
#define FT_UINT64 unsigned long long int
302
311
303
- #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
304
-
305
-
306
- /*************************************************************************/
307
- /* */
308
- /* A 64-bit data type will create compilation problems if you compile */
309
- /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */
310
- /* is defined. You can however ignore this rule by defining the */
311
- /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
312
- /* */
313
- #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
314
-
315
- #ifdef __STDC__
316
-
317
- /* undefine the 64-bit macros in strict ANSI compilation mode */
318
- #undef FT_LONG64
319
- #undef FT_INT64
320
-
321
- #endif /* __STDC__ */
312
+ #endif /* _MSC_VER */
322
313
323
- #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
314
+ #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
324
315
325
316
#ifdef FT_LONG64
326
317
typedef FT_INT64 FT_Int64 ;
327
318
typedef FT_UINT64 FT_UInt64 ;
328
319
#endif
329
320
330
321
322
+ /*************************************************************************/
323
+ /* */
324
+ /* miscellaneous */
325
+ /* */
326
+ /*************************************************************************/
327
+
328
+
331
329
#define FT_BEGIN_STMNT do {
332
330
#define FT_END_STMNT } while ( 0 )
333
331
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
334
332
335
333
336
- #ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
337
- /* Provide assembler fragments for performance-critical functions. */
338
- /* These must be defined `static __inline__' with GCC. */
339
-
340
- #if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
341
- #define FT_MULFIX_ASSEMBLER FT_MulFix_arm
342
-
343
- /* documentation is in freetype.h */
344
-
345
- static __inline FT_Int32
346
- FT_MulFix_arm ( FT_Int32 a ,
347
- FT_Int32 b )
348
- {
349
- register FT_Int32 t , t2 ;
350
-
351
-
352
- __asm
353
- {
354
- smull t2 , t , b , a /* (lo=t2,hi=t) = a*b */
355
- mov a , t , asr #31 /* a = (hi >> 31) */
356
- add a , a , #0x8000 /* a += 0x8000 */
357
- adds t2 , t2 , a /* t2 += a */
358
- adc t , t , #0 /* t += carry */
359
- mov a , t2 , lsr #16 /* a = t2 >> 16 */
360
- orr a , a , t , lsl #16 /* a |= t << 16 */
361
- }
362
- return a ;
363
- }
364
-
365
- #endif /* __CC_ARM || __ARMCC__ */
366
-
367
-
368
- #ifdef __GNUC__
369
-
370
- #if defined( __arm__ ) && !defined( __thumb__ ) && \
371
- !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
372
- #define FT_MULFIX_ASSEMBLER FT_MulFix_arm
373
-
374
- /* documentation is in freetype.h */
375
-
376
- static __inline__ FT_Int32
377
- FT_MulFix_arm ( FT_Int32 a ,
378
- FT_Int32 b )
379
- {
380
- register FT_Int32 t , t2 ;
381
-
382
-
383
- __asm__ __volatile__ (
384
- "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
385
- "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
386
- "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
387
- "adds %1, %1, %0\n\t" /* %1 += %0 */
388
- "adc %2, %2, #0\n\t" /* %2 += carry */
389
- "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
390
- "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
391
- : "=r" (a ), "=&r" (t2 ), "=&r" (t )
392
- : "r" (a ), "r" (b )
393
- : "cc" );
394
- return a ;
395
- }
396
-
397
- #endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
398
-
399
- #if defined( __i386__ )
400
- #define FT_MULFIX_ASSEMBLER FT_MulFix_i386
401
-
402
- /* documentation is in freetype.h */
403
-
404
- static __inline__ FT_Int32
405
- FT_MulFix_i386 ( FT_Int32 a ,
406
- FT_Int32 b )
407
- {
408
- register FT_Int32 result ;
409
-
410
-
411
- __asm__ __volatile__ (
412
- "imul %%edx\n"
413
- "movl %%edx, %%ecx\n"
414
- "sarl $31, %%ecx\n"
415
- "addl $0x8000, %%ecx\n"
416
- "addl %%ecx, %%eax\n"
417
- "adcl $0, %%edx\n"
418
- "shrl $16, %%eax\n"
419
- "shll $16, %%edx\n"
420
- "addl %%edx, %%eax\n"
421
- : "=a" (result ), "=d" (b )
422
- : "a" (a ), "d" (b )
423
- : "%ecx" , "cc" );
424
- return result ;
425
- }
426
-
427
- #endif /* i386 */
428
-
429
- #endif /* __GNUC__ */
430
-
431
-
432
- #ifdef _MSC_VER /* Visual C++ */
433
-
434
- #ifdef _M_IX86
435
-
436
- #define FT_MULFIX_ASSEMBLER FT_MulFix_i386
437
-
438
- /* documentation is in freetype.h */
439
-
440
- static __inline FT_Int32
441
- FT_MulFix_i386 ( FT_Int32 a ,
442
- FT_Int32 b )
443
- {
444
- register FT_Int32 result ;
445
-
446
- __asm
447
- {
448
- mov eax , a
449
- mov edx , b
450
- imul edx
451
- mov ecx , edx
452
- sar ecx , 31
453
- add ecx , 8000 h
454
- add eax , ecx
455
- adc edx , 0
456
- shr eax , 16
457
- shl edx , 16
458
- add eax , edx
459
- mov result , eax
460
- }
461
- return result ;
462
- }
463
-
464
- #endif /* _M_IX86 */
465
-
466
- #endif /* _MSC_VER */
467
-
468
- #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
469
-
470
-
471
- #ifdef FT_CONFIG_OPTION_INLINE_MULFIX
472
- #ifdef FT_MULFIX_ASSEMBLER
473
- #define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER
474
- #endif
334
+ /* typeof condition taken from gnulib's `intprops.h' header file */
335
+ #if ( __GNUC__ >= 2 || \
336
+ defined( __IBM__TYPEOF__ ) || \
337
+ ( __SUNPRO_C >= 0x5110 && !__STDC__ ) )
338
+ #define FT_TYPEOF ( type ) (__typeof__ (type))
339
+ #else
340
+ #define FT_TYPEOF ( type ) /* empty */
475
341
#endif
476
342
477
343
@@ -492,6 +358,9 @@ FT_BEGIN_HEADER
492
358
493
359
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
494
360
361
+ #define FT_LOCAL_ARRAY ( x ) extern const x
362
+ #define FT_LOCAL_ARRAY_DEF ( x ) const x
363
+
495
364
496
365
#ifndef FT_BASE
497
366
0 commit comments