shithub: freetype+ttf2subf

Download patch

ref: 027357f1c8d51657c10fd2fc3c085216613fd864
parent: da5ada5def3cba626d449481ac3447944256d39b
author: Suzuki, Toshiya (鈴木俊哉) <[email protected]>
date: Sun Feb 4 21:50:45 EST 2007

* Check ANSI compatibility of Mac OS X system header

git/fs: mount .git/fs: mount/attach disallowed
--- a/builds/mac/ftmac.c
+++ b/builds/mac/ftmac.c
@@ -70,8 +70,10 @@
   /* This is for Mac OS X.  Without redefinition, OS_INLINE */
   /* expands to `static inline' which doesn't survive the   */
   /* -ansi compilation flag of GCC.                         */
+#if !HAVE_ANSI_OS_INLINE
 #undef  OS_INLINE
 #define OS_INLINE   static __inline__
+#endif
 #include <Carbon/Carbon.h>
 #else
 #include <Resources.h>
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -199,7 +199,34 @@
       UseResFile( res );
 
     ],
-    [AC_MSG_RESULT([ok])],
+    [AC_MSG_RESULT([ok])
+     AC_MSG_CHECKING([OS_INLINE macro is ANSI compatible])
+     orig_CFLAGS="$CFLAGS"
+     CFLAGS="$CFLAGS $XX_CFLAGS $XX_ANSIFLAGS"
+     AC_TRY_COMPILE([
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <Carbon/Carbon.h>
+# include <ApplicationServices/ApplicationServices.h>
+#else
+# include <ConditionalMacros.h>
+# include <Files.h>
+#endif
+       ],
+       [
+         /* OSHostByteOrder() is typed as 'OS_INLINE' */
+         int32_t os_byte_order = OSHostByteOrder();
+         if ( OSBigEndian != os_byte_order )
+           return 1;
+       ],
+       [
+         AC_MSG_RESULT([ok])
+         CFLAGS="$orig_CFLAGS"
+         CFLAGS="$CFLAGS -DHAVE_ANSI_OS_INLINE=1"
+       ],[
+         AC_MSG_RESULT([no, ANSI incompatible])
+         CFLAGS="$orig_CFLAGS"
+       ])
+    ],
     [AC_MSG_RESULT([not found])
      LDFLAGS="${orig_LDFLAGS}"
      CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"])
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -72,8 +72,10 @@
   /* This is for Mac OS X.  Without redefinition, OS_INLINE */
   /* expands to `static inline' which doesn't survive the   */
   /* -ansi compilation flag of GCC.                         */
+#if !HAVE_ANSI_OS_INLINE
 #undef  OS_INLINE
 #define OS_INLINE   static __inline__
+#endif
 #include <Carbon/Carbon.h>
 
 #ifndef HFS_MAXPATHLEN