? root Index: ChangeLog =================================================================== RCS file: /sources/freetype/freetype2/ChangeLog,v retrieving revision 1.1780 diff -u -r1.1780 ChangeLog --- ChangeLog 18 Aug 2008 06:02:06 -0000 1.1780 +++ ChangeLog 18 Aug 2008 11:19:21 -0000 @@ -1,5 +1,12 @@ 2008-08-18 suzuki toshiya + * builds/unix/ftconfig.in: Add a configure-less computation of + FT_SIZEOF_INT and FT_SIZEOF_LONG from limits.h. It can support + multiple and incompatible architechtures by single ftconfig.h. + This fixes Savannah bug #21250. + +2008-08-18 suzuki toshiya + * src/base/ftmac.c: Add a fallback to suppose the availability of ResourceIndex type. It is used when built without configure (e.g. build by Jam). Index: builds/unix/ftconfig.in =================================================================== RCS file: /sources/freetype/freetype2/builds/unix/ftconfig.in,v retrieving revision 1.22 diff -u -r1.22 ftconfig.in --- builds/unix/ftconfig.in 28 Mar 2007 21:17:10 -0000 1.22 +++ builds/unix/ftconfig.in 18 Aug 2008 11:19:22 -0000 @@ -60,15 +60,135 @@ #undef HAVE_UNISTD_H #undef HAVE_FCNTL_H -#undef SIZEOF_INT -#undef SIZEOF_LONG - - -#define FT_SIZEOF_INT SIZEOF_INT -#define FT_SIZEOF_LONG SIZEOF_LONG - #define FT_CHAR_BIT CHAR_BIT +#define FT_IS_GE_NBYTE( x, n ) \ + ( ( SCHAR_MAX ) <= ( ( x ) >> ( FT_CHAR_BIT * ( n ) ) ) ) +#define FT_IS_LT_NBYTE( x, n ) \ + ( ( SCHAR_MAX ) > ( ( x ) >> ( FT_CHAR_BIT * ( n ) ) ) ) +#define FT_IS_IN_NBYTE_RANGE( x, n ) \ + ( FT_IS_GE_NBYTE( x, n - 1 ) && FT_IS_LT_NBYTE( x, n ) ) + + +/* check cpp can handle 64bit constant */ +#if ( 0x7FFFFFFFUL < 0x7FFFFFFFFFFFFFFFUL ) && !defined( USE_PROVEN_SIZES ) + +# if ( INT_MAX < 0x7FFF ) +# error Non-standard C whose int cannot cover signed 16bit +# elif FT_IS_IN_NBYTE_RANGE( INT_MAX, 1 ) +# define FT_SIZEOF_INT 1 +# elif FT_IS_IN_NBYTE_RANGE( INT_MAX, 2 ) +# define FT_SIZEOF_INT 2 +# elif FT_IS_IN_NBYTE_RANGE( INT_MAX, 3 ) +# define FT_SIZEOF_INT 3 +# elif FT_IS_IN_NBYTE_RANGE( INT_MAX, 4 ) +# define FT_SIZEOF_INT 4 +# elif FT_IS_IN_NBYTE_RANGE( INT_MAX, 5 ) +# define FT_SIZEOF_INT 5 +# elif FT_IS_IN_NBYTE_RANGE( INT_MAX, 6 ) +# define FT_SIZEOF_INT 6 +# elif FT_IS_IN_NBYTE_RANGE( INT_MAX, 7 ) +# define FT_SIZEOF_INT 7 +# elif FT_IS_IN_NBYTE_RANGE( INT_MAX, 8 ) +# define FT_SIZEOF_INT 8 +# else +# define USE_PROVEN_SIZES +# endif + +# if ( LONG_MAX < 0x7FFFFFFF ) +# error Non-standard C whose int cannot cover signed 16bit +# elif FT_IS_IN_NBYTE_RANGE( LONG_MAX, 1 ) +# define FT_SIZEOF_LONG 1 +# elif FT_IS_IN_NBYTE_RANGE( LONG_MAX, 2 ) +# define FT_SIZEOF_LONG 2 +# elif FT_IS_IN_NBYTE_RANGE( LONG_MAX, 3 ) +# define FT_SIZEOF_LONG 3 +# elif FT_IS_IN_NBYTE_RANGE( LONG_MAX, 4 ) +# define FT_SIZEOF_LONG 4 +# elif FT_IS_IN_NBYTE_RANGE( LONG_MAX, 5 ) +# define FT_SIZEOF_LONG 5 +# elif FT_IS_IN_NBYTE_RANGE( LONG_MAX, 6 ) +# define FT_SIZEOF_LONG 6 +# elif FT_IS_IN_NBYTE_RANGE( LONG_MAX, 7 ) +# define FT_SIZEOF_LONG 7 +# elif FT_IS_IN_NBYTE_RANGE( LONG_MAX, 8 ) +# define FT_SIZEOF_LONG 8 +# else +# define USE_PROVEN_SIZES +# endif + + + +#else /* cpp cannot handle 64bit constant */ + + /* + * Here we list the environment that can execute multiple ABIs + * with different bitsize (e.g. IRIX on mips64, AIX on ppc64) + * or build binary for multiple ABIs by single SDK (Mac OS X). + * The environment that use single ABIs or multiple ABIs but + * same bit-length should be prepared by configure. + */ +# if defined( linux ) || defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) +# if defined( __amd64 ) || defined( __ia64 ) || defined( __ppc64 ) || defined( __mips64 ) || defined( __sparc64 ) || defined( __sh64 ) +# define __FT_LP64__ 1 +# elif defined( __i386 ) || defined( __ppc ) || defined( __mips ) || defined( __sparc ) || defined( __sh ) +# define __FT_LP32__ 1 +# endif + + /* AIX */ +# elif defined( _AIX ) /* See /usr/include/sys/limits.h */ +# if defined( __64BIT__ ) +# define __FT_LP64__ 1 +# else +# define __FT_LP32__ 1 +# endif + + /* HP-UX */ +# elif defined( __hpux ) +# ifndef __FT_LP64__ +# define __FT_LP32__ 1 +# endif + + /* IRIX */ +# elif defined( sgi ) +# if defined( _MIPS_SZLONG ) && ( _MIPS_SZLONG == 64 ) +# define __FT_LP64__ +# else +# define __FT_LP32__ +# endif + + /* Solaris */ +# elif defined( sun ) +# ifdef _LP64 +# define __FT_LP64__ +# else +# define __FT_LP32__ +# endif + +# endif + +# if defined( __LP32__ ) || defined( __FT_LP32__ ) || defined( __FT_LLP64__ ) +# define FT_SIZEOF_INT 4 +# define FT_SIZEOF_LONG 4 +# elif defined( __LP64__ ) || defined( __FT_LP64__ ) +# define FT_SIZEOF_INT 4 +# define FT_SIZEOF_LONG 8 +# elif defined( __ILP64__ ) +# define FT_SIZEOF_INT 8 +# define FT_SIZEOF_LONG 8 +# else +# define USE_PROVEN_SIZES +# endif + +#endif + +#ifdef USE_PROVEN_SIZES +# undef SIZEOF_INT +# undef SIZEOF_LONG +# define FT_SIZEOF_INT SIZEOF_INT +# define FT_SIZEOF_LONG SIZEOF_LONG +#endif + /* Preferred alignment of data */ #define FT_ALIGNMENT 8