shithub: freetype+ttf2subf

Download patch

ref: 714ee56ab152ae364eb49260acf2c9a114b44825
parent: 2968bd60984742c11f98ebf9ffc728793fcbf242
author: suzuki toshiya <[email protected]>
date: Fri Dec 2 16:14:18 EST 2011

[mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH.

Originally FT_MACINTOSH was a pure auto macro and DARWIN_NO_CARBON
was a configurable macro to disable Carbon-dependent code.  Because
now configure script sets DARWIN_NO_CARBON by default and disables
Darwin & Carbon-dependent codes, these macros can be unified.
FT_MACINTOSH (undefined by default) is kept and DARWIN_NO_CARBON
(defined by default) is removed, because DARWIN_NO_CARBON violates
FT_XXX naming convention of public macros, and a macro configured by
default is not portable for the building without configure (e.g.
make devel).

* builds/unix/configure.raw: Define FT_MACINTOSH if Carbon-based
old Mac font support is requested and Carbon is available.
* builds/unix/ftconfig.in: Undefine FT_MACINTOSH when the support
for Mac OS X without Carbon (e.g.  Mac OS X 10.4 for ppc64) is
requested.
* include/freetype/config/ftconfig.in: Ditto.
* builds/vms/ftconfig.h: Ditto.

* src/base/ftbase.h: Remove DARWIN_NO_CARBON.
* src/base/ftbase.c: Ditto.
* src/base/ftobjs.c: Ditto.
* src/base/ftrfork.c: Ditto.

* src/base/ftmac.c: Compile the body if FT_MACINTOSH is defined
(same with TT_USE_BYTECODE_INTERPRETER in ttinterp.c).
* builds/mac/ftmac.c: Ditto.

* builds/mac/FreeType.m68k_cfm.make.txt: Define FT_MACINTOSH.
* builds/mac/FreeType.m68k_far.make.txt: Ditto.
* builds/mac/FreeType.ppc_classic.make.txt: Ditto.
* builds/mac/FreeType.ppc_carbon.make.txt: Ditto.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2011-12-02  suzuki toshiya  <[email protected]>
+
+	[mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH.
+
+	Originally FT_MACINTOSH was a pure auto macro and DARWIN_NO_CARBON
+	was a configurable macro to disable Carbon-dependent code.  Because
+	now configure script sets DARWIN_NO_CARBON by default and disables
+	Darwin & Carbon-dependent codes, these macros can be unified.
+	FT_MACINTOSH (undefined by default) is kept and DARWIN_NO_CARBON
+	(defined by default) is removed, because DARWIN_NO_CARBON violates
+	FT_XXX naming convention of public macros, and a macro configured by 
+	default is not portable for the building without configure (e.g.
+	make devel).
+
+	* builds/unix/configure.raw: Define FT_MACINTOSH if Carbon-based
+	old Mac font support is requested and Carbon is available.
+	* builds/unix/ftconfig.in: Undefine FT_MACINTOSH when the support
+	for Mac OS X without Carbon (e.g.  Mac OS X 10.4 for ppc64) is
+	requested.
+	* include/freetype/config/ftconfig.in: Ditto.
+	* builds/vms/ftconfig.h: Ditto.
+
+	* src/base/ftbase.h: Remove DARWIN_NO_CARBON.
+	* src/base/ftbase.c: Ditto.
+	* src/base/ftobjs.c: Ditto.
+	* src/base/ftrfork.c: Ditto.
+
+	* src/base/ftmac.c: Compile the body if FT_MACINTOSH is defined
+	(same with TT_USE_BYTECODE_INTERPRETER in ttinterp.c).
+	* builds/mac/ftmac.c: Ditto.
+
+	* builds/mac/FreeType.m68k_cfm.make.txt: Define FT_MACINTOSH.
+	* builds/mac/FreeType.m68k_far.make.txt: Ditto.
+	* builds/mac/FreeType.ppc_classic.make.txt: Ditto.
+	* builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
+
 2011-11-30  suzuki toshiya  <[email protected]>
 
 	Fix Savannah bug #34728 (`make devel' on Mac OS X).
--- a/builds/mac/FreeType.m68k_cfm.make.txt
+++ b/builds/mac/FreeType.m68k_cfm.make.txt
@@ -17,6 +17,7 @@
 Sym-68K         = -sym off
 
 COptions        = \xB6
+			-d FT_MACINTOSH=1 \xB6
 			-d HAVE_FSSPEC=1 \xB6
 			-d HAVE_FSREF=0 \xB6
 			-d HAVE_QUICKDRAW_TOOLBOX=1 \xB6
--- a/builds/mac/FreeType.m68k_far.make.txt
+++ b/builds/mac/FreeType.m68k_far.make.txt
@@ -16,6 +16,7 @@
 Sym-68K         = -sym off
 
 COptions        = \xB6
+			-d FT_MACINTOSH=1 \xB6
 			-d HAVE_FSSPEC=1 \xB6
 			-d HAVE_FSREF=0 \xB6
 			-d HAVE_QUICKDRAW_TOOLBOX=1 \xB6
--- a/builds/mac/FreeType.ppc_carbon.make.txt
+++ b/builds/mac/FreeType.ppc_carbon.make.txt
@@ -17,6 +17,7 @@
 Sym-PPC         = -sym off
 
 PPCCOptions     = \xB6
+			-d FT_MACINTOSH=1 \xB6
 			-d HAVE_FSSPEC=1 \xB6
                         -d HAVE_FSREF=1 \xB6
 			-d HAVE_QUICKDRAW_TOOLBOX=1 \xB6
--- a/builds/mac/FreeType.ppc_classic.make.txt
+++ b/builds/mac/FreeType.ppc_classic.make.txt
@@ -17,6 +17,7 @@
 Sym-PPC         = -sym off
 
 PPCCOptions     = \xB6
+                        -d FT_MACINTOSH=1 \xB6
                         -d HAVE_FSSPEC=1 \xB6
                         -d HAVE_FSREF=0 \xB6
                         -d HAVE_QUICKDRAW_TOOLBOX=1 \xB6
--- a/builds/mac/ftmac.c
+++ b/builds/mac/ftmac.c
@@ -171,6 +171,7 @@
 #define PREFER_LWFN  1
 #endif
 
+#ifdef FT_MACINTOSH
 
 #if !HAVE_QUICKDRAW_CARBON  /* QuickDraw is deprecated since Mac OS X 10.4 */
 
@@ -1526,6 +1527,8 @@
 #endif /* HAVE_FSREF, HAVE_FSSPEC */
 
   }
+
+#endif /* FT_MACINTOSH */
 
 
 /* END */
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -331,7 +331,7 @@
     [AC_MSG_RESULT([ok])
      ftmac_c='ftmac.c'
      AC_MSG_CHECKING([OS_INLINE macro is ANSI compatible])
-     orig_CFLAGS="$CFLAGS"
+     orig_CFLAGS="$CFLAGS -DFT_MACINTOSH"
      CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
      AC_COMPILE_IFELSE([
        AC_LANG_PROGRAM([
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -142,8 +142,7 @@
   /*   This is the only necessary change, so it is defined here instead    */
   /*   providing a new configuration file.                                 */
   /*                                                                       */
-#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
-    ( defined( __MWERKS__ ) && defined( macintosh )        )
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
   /* no Carbon frameworks for 64bit 10.4.x */
   /* AvailabilityMacros.h is available since Mac OS X 10.2,        */
   /* so guess the system version by maximum errno before inclusion */
@@ -153,9 +152,7 @@
 #endif
 #if defined( __LP64__ ) && \
     ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
-#define DARWIN_NO_CARBON 1
-#else
-#define FT_MACINTOSH 1
+/undef FT_MACINTOSH
 #endif
 
 #elif defined( __SC__ ) || defined( __MRC__ )
--- a/builds/vms/ftconfig.h
+++ b/builds/vms/ftconfig.h
@@ -95,8 +95,7 @@
   /*   This is the only necessary change, so it is defined here instead    */
   /*   providing a new configuration file.                                 */
   /*                                                                       */
-#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
-    ( defined( __MWERKS__ ) && defined( macintosh )        )
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
   /* no Carbon frameworks for 64bit 10.4.x */
   /* AvailabilityMacros.h is available since Mac OS X 10.2,        */
   /* so guess the system version by maximum errno before inclusion */
@@ -106,9 +105,7 @@
 #endif
 #if defined( __LP64__ ) && \
     ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
-#define DARWIN_NO_CARBON 1
-#else
-#define FT_MACINTOSH 1
+#undef FT_MACINTOSH
 #endif
 
 #elif defined( __SC__ ) || defined( __MRC__ )
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -120,8 +120,7 @@
   /*   This is the only necessary change, so it is defined here instead    */
   /*   providing a new configuration file.                                 */
   /*                                                                       */
-#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
-    ( defined( __MWERKS__ ) && defined( macintosh )        )
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
   /* no Carbon frameworks for 64bit 10.4.x */
   /* AvailabilityMacros.h is available since Mac OS X 10.2,        */
   /* so guess the system version by maximum errno before inclusion */
@@ -131,9 +130,7 @@
 #endif
 #if defined( __LP64__ ) && \
     ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
-#define DARWIN_NO_CARBON 1
-#else
-#define FT_MACINTOSH 1
+#undef FT_MACINTOSH
 #endif
 
 #elif defined( __SC__ ) || defined( __MRC__ )
--- a/src/base/ftbase.c
+++ b/src/base/ftbase.c
@@ -34,7 +34,7 @@
 #include "fttrigon.c"
 #include "ftutil.c"
 
-#if defined( FT_MACINTOSH ) && !defined ( DARWIN_NO_CARBON )
+#ifdef FT_MACINTOSH
 #include "ftmac.c"
 #endif
 
--- a/src/base/ftbase.h
+++ b/src/base/ftbase.h
@@ -49,8 +49,8 @@
                          FT_Face     *aface );
 
 
-#if defined( FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK ) && \
-    ( !defined( FT_MACINTOSH ) || defined( DARWIN_NO_CARBON ) )
+#if  defined( FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK ) && \
+    !defined( FT_MACINTOSH )
   /* Mac OS X/Darwin kernel often changes recommended method to access */
   /* the resource fork and older methods makes the kernel issue the    */
   /* warning of deprecated method.  To calm it down, the methods based */
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -119,6 +119,8 @@
 #endif
 
 
+#ifdef FT_MACINTOSH
+
   /* This function is deprecated because FSSpec is deprecated in Mac OS X  */
   FT_EXPORT_DEF( FT_Error )
   FT_GetFile_From_Mac_Name( const char*  fontName,
@@ -1052,6 +1054,8 @@
       return FT_New_Face_From_FSRef( library, &ref, face_index, aface );
 #endif
   }
+
+#endif /* FT_MACINTOSH */
 
 
 /* END */
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1187,7 +1187,7 @@
   /* there's a Mac-specific extended implementation of FT_New_Face() */
   /* in src/base/ftmac.c                                             */
 
-#if !defined( FT_MACINTOSH ) || defined( DARWIN_NO_CARBON )
+#ifndef FT_MACINTOSH
 
   /* documentation is in freetype.h */
 
@@ -1211,7 +1211,7 @@
     return FT_Open_Face( library, &args, face_index, aface );
   }
 
-#endif  /* defined( FT_MACINTOSH ) && !defined( DARWIN_NO_CARBON ) */
+#endif
 
 
   /* documentation is in freetype.h */
@@ -1520,7 +1520,7 @@
   }
 
 
-#if !defined( FT_MACINTOSH ) || defined( DARWIN_NO_CARBON )
+#ifndef FT_MACINTOSH
 
   /* The resource header says we've got resource_cnt `POST' (type1) */
   /* resources in this file.  They all need to be coalesced into    */
--- a/src/base/ftrfork.c
+++ b/src/base/ftrfork.c
@@ -417,7 +417,7 @@
   }
 
 
-#if !defined( FT_MACINTOSH ) || defined( DARWIN_NO_CARBON )
+#ifndef FT_MACINTOSH
   static FT_RFork_Rule
   raccess_get_rule_type_from_rule_index( FT_UInt  rule_index )
   {