[mac] Conditionalize the inclusion of "AvailabilityMacros.h". The native SDK on earliest Mac OS X (10.0-10.1) did not have "AvailabilityMacros.h". To prevent the inclusion of missing header file, ECANCELED (introduced in 10.2) in POSIX header file <errno.h> is checked to detect the system version. * include/freetype/config/ftconfig.h: Conditionalize the inclusion of "AvailabilityMacros.h". * builds/unix/ftconfig.in: Ditto. * builds/vms/ftconfig.h: 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
diff --git a/ChangeLog b/ChangeLog
index 79a3e07..ec9483b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-05-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+ [mac] Conditionalize the inclusion of "AvailabilityMacros.h".
+
+ The native SDK on earliest Mac OS X (10.0-10.1) did not have
+ "AvailabilityMacros.h". To prevent the inclusion of missing
+ header file, ECANCELED (introduced in 10.2) in POSIX header
+ file <errno.h> is checked to detect the system version.
+
+ * include/freetype/config/ftconfig.h: Conditionalize the
+ inclusion of "AvailabilityMacros.h".
+ * builds/unix/ftconfig.in: Ditto.
+ * builds/vms/ftconfig.h: Ditto.
+
2011-05-27 Werner Lemberg <wl@gnu.org>
[autofit] Improve tracing of hinting process.
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
index d964925..50351a0 100644
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -149,7 +149,12 @@ FT_BEGIN_HEADER
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */
+ /* AvailabilityMacros.h was introduced since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h"
+#endif
#if defined( __LP64__ ) && \
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#define DARWIN_NO_CARBON 1
diff --git a/builds/vms/ftconfig.h b/builds/vms/ftconfig.h
index 1659d03..49b60a2 100644
--- a/builds/vms/ftconfig.h
+++ b/builds/vms/ftconfig.h
@@ -102,7 +102,12 @@ FT_BEGIN_HEADER
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */
+ /* AvailabilityMacros.h was introduced since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h"
+#endif
#if defined( __LP64__ ) && \
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#define DARWIN_NO_CARBON 1
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index dd9d10c..2297194 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -127,7 +127,12 @@ FT_BEGIN_HEADER
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */
+ /* AvailabilityMacros.h was introduced since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h"
+#endif
#if defined( __LP64__ ) && \
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#define DARWIN_NO_CARBON 1