Skip to content

Commit

Permalink
coretext: fix building with 10.5 SDK
Browse files Browse the repository at this point in the history
Turns out MacOSX10.5.sdk also defines __MAC_10_6
(but not MAC_OS_X_VERSION_10_6 or kCTFontURLAttribute).

Looking back, I switched from AvailabilityMacros.h to Availability.h
late in the development of libass#595,
and this switch may have gone untested back then.
This has been reported to successfuly compile more recently,
and this is a mystery, but it's possible that the reporter inadvertently
tested code with additional local changes that worked around this.

Fixes: libass#837
  • Loading branch information
astiob committed Oct 14, 2024
1 parent 25e34fc commit 6a75983
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libass/ass_coretext.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "config.h"
#include "ass_compat.h"

#include <Availability.h>
#include <AvailabilityMacros.h>
#include <CoreFoundation/CoreFoundation.h>
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
Expand Down Expand Up @@ -87,13 +87,13 @@ static char *get_font_file(CTFontDescriptorRef fontd)
{
CFURLRef url = NULL;
if (false) {}
#ifdef __MAC_10_6
#ifdef MAC_OS_X_VERSION_10_6
// Declared in SDKs since 10.6, including iOS SDKs
else if (CHECK_AVAILABLE(kCTFontURLAttribute, macOS 10.6, *)) {
url = CTFontDescriptorCopyAttribute(fontd, kCTFontURLAttribute);
}
#endif
#if !TARGET_OS_IPHONE && (!defined(__MAC_10_6) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6)
#if !TARGET_OS_IPHONE && MAC_OS_X_VERSION_MIN_REQUIRED < 1060
// ATS is declared deprecated in newer macOS SDKs
// and not declared at all in iOS SDKs
else {
Expand Down

0 comments on commit 6a75983

Please sign in to comment.