[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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
diff --git a/ChangeLog b/ChangeLog
index ad8469e..ab308cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2011-12-02 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+ [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 <mpsuzuki@hiroshima-u.ac.jp>
Fix Savannah bug #34728 (`make devel' on Mac OS X).
diff --git a/builds/mac/FreeType.m68k_cfm.make.txt b/builds/mac/FreeType.m68k_cfm.make.txt
index 0bd1452..425f9f9 100644
--- a/builds/mac/FreeType.m68k_cfm.make.txt
+++ b/builds/mac/FreeType.m68k_cfm.make.txt
@@ -17,6 +17,7 @@ Includes = \xB6
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
diff --git a/builds/mac/FreeType.m68k_far.make.txt b/builds/mac/FreeType.m68k_far.make.txt
index e8e2f6e..ebf5a1b 100644
--- a/builds/mac/FreeType.m68k_far.make.txt
+++ b/builds/mac/FreeType.m68k_far.make.txt
@@ -16,6 +16,7 @@ Includes = \xB6
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
diff --git a/builds/mac/FreeType.ppc_carbon.make.txt b/builds/mac/FreeType.ppc_carbon.make.txt
index c37e0f3..2926413 100644
--- a/builds/mac/FreeType.ppc_carbon.make.txt
+++ b/builds/mac/FreeType.ppc_carbon.make.txt
@@ -17,6 +17,7 @@ Includes = \xB6
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
diff --git a/builds/mac/FreeType.ppc_classic.make.txt b/builds/mac/FreeType.ppc_classic.make.txt
index 0c0991e..377de9a 100644
--- a/builds/mac/FreeType.ppc_classic.make.txt
+++ b/builds/mac/FreeType.ppc_classic.make.txt
@@ -17,6 +17,7 @@ Includes = \xB6
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
diff --git a/builds/mac/ftmac.c b/builds/mac/ftmac.c
index c974f67..719dd0c 100644
--- a/builds/mac/ftmac.c
+++ b/builds/mac/ftmac.c
@@ -171,6 +171,7 @@ typedef short ResourceIndex;
#define PREFER_LWFN 1
#endif
+#ifdef FT_MACINTOSH
#if !HAVE_QUICKDRAW_CARBON /* QuickDraw is deprecated since Mac OS X 10.4 */
@@ -1527,5 +1528,7 @@ typedef short ResourceIndex;
}
+#endif /* FT_MACINTOSH */
+
/* END */
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index c557480..d51ae90 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -331,7 +331,7 @@ if test x$with_old_mac_fonts = xyes; then
[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([
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
index fd4a5cd..9531afd 100644
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -142,8 +142,7 @@ FT_BEGIN_HEADER
/* 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 @@ FT_BEGIN_HEADER
#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__ )
diff --git a/builds/vms/ftconfig.h b/builds/vms/ftconfig.h
index 99c37db..62fadac 100644
--- a/builds/vms/ftconfig.h
+++ b/builds/vms/ftconfig.h
@@ -95,8 +95,7 @@ FT_BEGIN_HEADER
/* 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 @@ FT_BEGIN_HEADER
#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__ )
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index a9e767c..5628569 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -120,8 +120,7 @@ FT_BEGIN_HEADER
/* 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 @@ FT_BEGIN_HEADER
#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__ )
diff --git a/src/base/ftbase.c b/src/base/ftbase.c
index 6a27ea9..5e5d70e 100644
--- 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
diff --git a/src/base/ftbase.h b/src/base/ftbase.h
index 516f4bb..cb55197 100644
--- a/src/base/ftbase.h
+++ b/src/base/ftbase.h
@@ -49,8 +49,8 @@ FT_BEGIN_HEADER
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 */
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index 63f927d..d892bf1 100644
--- 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,
@@ -1053,5 +1055,7 @@
#endif
}
+#endif /* FT_MACINTOSH */
+
/* END */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 64575af..1a5a327 100644
--- 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 */
diff --git a/src/base/ftrfork.c b/src/base/ftrfork.c
index 33768b0..e58d2fc 100644
--- 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 )
{