freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] freetype 2.3.6 compile error on Mac 10.4


From: Sean McBride
Subject: Re: [ft-devel] freetype 2.3.6 compile error on Mac 10.4
Date: Wed, 25 Jun 2008 15:14:10 -0400

On 6/25/08 2:14 AM, address@hidden said:

>I've checked my G4 PowerBook with Mac OS X 10.4.11 + 10.4u SDK,
>its header file does not define the macro MAC_OS_X_VERSION_10_5.
>But 10.4u SDK bundled in 10.5 defines it.

Apple often updates their SDKs between releases of Xcode and OSes, which
explains what you see here.

But "MAC_OS_X_VERSION_10_5" is just a constant, it does not indicate the
SDK version.  The numbering is obvious, see AvailabilityMacros.h:

#define MAC_OS_X_VERSION_10_0 1000
#define MAC_OS_X_VERSION_10_1 1010
#define MAC_OS_X_VERSION_10_2 1020
#define MAC_OS_X_VERSION_10_3 1030
#define MAC_OS_X_VERSION_10_4 1040
#define MAC_OS_X_VERSION_10_5 1050

So we could simplify:

#if defined( MAC_OS_X_VERSION_10_5 ) && \
    ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 )

to:

#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050

I think it is still very readable and it has the advantage of working
with any SDK, even back to 10.0.

Note that developers often confuse the meanings of
MAC_OS_X_VERSION_MAX_ALLOWED and MAC_OS_X_VERSION_MIN_REQUIRED.

To check for the 10.5 SDK use:
#if MAC_OS_X_VERSION_MAX_ALLOWED

To check the minimum supported OS version ("Mac OS X deployment target"
build setting) use:
#if MAC_OS_X_VERSION_MIN_REQUIRED

So the previous conditional declaration of ResourceIndex was wrong, but
adding something to the configure script is not the ideal solution in my
option.  For example, it breaks VTK which uses freetype but does not use
freetype's configure stuff (it uses CMake).  A better solution is to
just test the SDK version.

I have attached a patch.  Suzuki-San, can you review and commit?

--
____________________________________________________________
Sean McBride, B. Eng                 address@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

Attachment: freetype_patch.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]