[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft] Proposal to hide FT_MACINTOSH from ftconfig.h
From: |
suzuki toshiya |
Subject: |
[ft] Proposal to hide FT_MACINTOSH from ftconfig.h |
Date: |
Sat, 28 May 2011 18:25:44 +0900 |
User-agent: |
Mozilla-Thunderbird 2.0.0.12 (X11/20080406) |
Hi all,
Now I'm working with Savannah Bug #32321, and I will
improve the C preprocessor hook (to forcibly disable
Carbon dependent feature on the recent 64bit platforms
without Carbon framework) in ftconfig.h to work with
legacy Mac OS X (10.0-10.1), like this:
---------------------------------------------------------------------
#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 */
/* of AvailabilityMacros.h */
#include <errno.h>
#if EBADMACHO < ELAST
#include "AvailabilityMacros.h"
#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
#endif
#elif defined( __SC__ ) || defined( __MRC__ )
/* Classic MacOS compilers */
#include "ConditionalMacros.h"
#if TARGET_OS_MAC
#define FT_MACINTOSH 1
#endif
#endif
--------------------------------------------------------------------
Checking the whole of ftconfig.h, now I think ftconfig.h
is not good place to store such library dependent hook.
ftconfig.h should include the architecture related hooks
to define the macros for variable size (ILP32, LP64 etc).
Furthermore, I think there is no need to expose such hook
in public header. In fact, the name DARWNIN_NO_CARBON
violates the name space convention of public FT2 interface.
Considering this hook is important for a few base module
sources (ftmac.c and ftobjs.c), I propose to move this
hook from public header to new file in base module
(e.g src/base/ftmaccnf.h).
There might be a concern that some FT2 client use FT_MACINTOSH.
I've search with Google code search and found an old Scribus
used this macro in scfonts.cpp, to guess if the platform is
Macintosh. However, FT_MACINTOSH should not be used for such,
and Scribus developers might found it, and they switched to use
another macro "Q_OS_MAC" by Qt.
http://scribus.net/websvn/diff.php?repname=Scribus&path=%2Fbranches%2FVersion13x%2FScribus%2Fscribus%2Fscfonts.cpp&rev=5980&peg=6561
In summary, now I think it won't be serious impact to hide
FT_MACINTOSH from public FT2 header. If anybody uses it now,
or want to use in future, please give me comment.
Regards,
mpsuzuki
- [ft] Proposal to hide FT_MACINTOSH from ftconfig.h,
suzuki toshiya <=