From f3a924dd53346dbb9da36f4917ff017b2b2cfd96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suzuki=2C=20Toshiya=20=28=E9=88=B4=E6=9C=A8=E4=BF=8A?= =?UTF-8?q?=E5=93=89=29?= Date: Tue, 24 Jun 2008 17:13:58 +0000 Subject: [PATCH] Fix for 10.4u SDK bundled to Mac OS X 10.5 --- ChangeLog | 12 ++++++++++++ builds/unix/configure.raw | 32 +++++++++++++++++++++++++++++++- src/base/ftmac.c | 10 +++++----- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9325a60a2..47fc4e42e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-06-24 suzuki toshiya + + * builds/unix/configure.raw: Check type "ResourceIndex" explicitly + and define HAVE_TYPE_RESOURCE_INDEX if it is defined. Mac OS X + 10.5 bundles 10.4u SDK with MAC_OS_X_VERSION_10_5 macro but without + ResourceIndex type definition. The macro does not inform the type + availability. + * src/base/ftmac.c: More parentheses are inserted to clarify the + conditionals to disable legacy APIs in "10.5 and later" cases. + If HAVE_TYPE_RESOURCE_INDEX is not defined, ResourceIndex is + defined. + 2008-06-24 Werner Lemberg * src/truetype/ttinterp. (Ins_SCANTYPE): Don't check rendering mode. diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw index 939e439bd..b69e4ae50 100644 --- a/builds/unix/configure.raw +++ b/builds/unix/configure.raw @@ -260,7 +260,37 @@ if test x$with_old_mac_fonts = xyes; then ], [AC_MSG_RESULT([no, ANSI incompatible]) CFLAGS="$orig_CFLAGS" - ])], + ]) + AC_MSG_CHECKING([type ResourceIndex]) + orig_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ + +#if defined(__GNUC__) && defined(__APPLE_CC__) +# include +# include +#else +# include +# include +# include +#endif + + ], + [ + + ResourceIndex i = 0; + return i; + + ])], + [AC_MSG_RESULT([ok]) + CFLAGS="$orig_CFLAGS" + CFLAGS="$CFLAGS -DHAVE_TYPE_RESOURCE_INDEX" + ], + [AC_MSG_RESULT([no]) + CFLAGS="$orig_CFLAGS" + ]) + ], [AC_MSG_RESULT([not found]) LDFLAGS="${orig_LDFLAGS}" CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"]) diff --git a/src/base/ftmac.c b/src/base/ftmac.c index 7f059076d..4f4ab9d8e 100644 --- a/src/base/ftmac.c +++ b/src/base/ftmac.c @@ -77,8 +77,8 @@ #define OS_INLINE static __inline__ #endif - /* The ResourceIndex type was only added in the 10.5 SDK */ -#ifndef MAC_OS_X_VERSION_10_5 + /* The ResourceIndex type was available SDKs on 10.5 */ +#ifndef HAVE_TYPE_RESOURCE_INDEX typedef short ResourceIndex; #endif @@ -134,7 +134,7 @@ typedef short ResourceIndex; FSRef* ats_font_ref ) { #if defined( MAC_OS_X_VERSION_10_5 ) && \ - MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 + ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) OSStatus err; @@ -235,7 +235,7 @@ typedef short ResourceIndex; FT_Long* face_index ) { #if ( __LP64__ ) || ( defined( MAC_OS_X_VERSION_10_5 ) && \ - MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) + ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) ) FT_UNUSED( fontName ); FT_UNUSED( pathSpec ); FT_UNUSED( face_index ); @@ -1108,7 +1108,7 @@ typedef short ResourceIndex; FT_Face* aface ) { #if ( __LP64__ ) || ( defined( MAC_OS_X_VERSION_10_5 ) && \ - MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) + ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) ) FT_UNUSED( library ); FT_UNUSED( spec ); FT_UNUSED( face_index );