From 027357f1c8d51657c10fd2fc3c085216613fd864 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: Mon, 5 Feb 2007 02:50:45 +0000 Subject: [PATCH] * Check ANSI compatibility of Mac OS X system header --- builds/mac/ftmac.c | 2 ++ builds/unix/configure.raw | 29 ++++++++++++++++++++++++++++- src/base/ftmac.c | 2 ++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/builds/mac/ftmac.c b/builds/mac/ftmac.c index 6c2483f3..59e99929 100644 --- 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 #else #include diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw index d0e3c4a7..254ae89e 100644 --- a/builds/unix/configure.raw +++ b/builds/unix/configure.raw @@ -199,7 +199,34 @@ if test x$with_old_mac_fonts = xyes; then 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 +# include +#else +# include +# include +#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"]) diff --git a/src/base/ftmac.c b/src/base/ftmac.c index ea47caaf..07a2dc7f 100644 --- 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 #ifndef HFS_MAXPATHLEN