diff options
author | Eugene Sandulenko | 2016-04-10 10:50:59 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-04-10 10:50:59 +0200 |
commit | aa5432b0e9c1545c4e7f952864eb542e4a3953f8 (patch) | |
tree | 557c48d071adba3eeeea8173575483d0840fd317 /backends | |
parent | 600520902eb08124716cb6a76b2bd0190444ae4c (diff) | |
download | scummvm-rg350-aa5432b0e9c1545c4e7f952864eb542e4a3953f8.tar.gz scummvm-rg350-aa5432b0e9c1545c4e7f952864eb542e4a3953f8.tar.bz2 scummvm-rg350-aa5432b0e9c1545c4e7f952864eb542e4a3953f8.zip |
UPDATES: Use new constants for MacOS X 10.10
Diffstat (limited to 'backends')
-rw-r--r-- | backends/updates/macosx/macosx-updates.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/backends/updates/macosx/macosx-updates.mm b/backends/updates/macosx/macosx-updates.mm index a7888a70e6..64d1028734 100644 --- a/backends/updates/macosx/macosx-updates.mm +++ b/backends/updates/macosx/macosx-updates.mm @@ -33,6 +33,8 @@ #include <Cocoa/Cocoa.h> #include <Sparkle/Sparkle.h> +#include <AvailabilityMacros.h> + SUUpdater *sparkleUpdater; /** @@ -136,8 +138,13 @@ int MacOSXUpdateManager::getUpdateCheckInterval() { bool MacOSXUpdateManager::getLastUpdateCheckTimeAndDate(TimeDate &t) { NSDate *date = [sparkleUpdater lastUpdateCheckDate]; +#ifdef MAC_OS_X_VERSION_10_10 + NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + NSDateComponents *components = [gregorian components:(NSCalendarUnitDay | NSCalendarUnitWeekday) fromDate:date]; +#else NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *components = [gregorian components:(NSDayCalendarUnit | NSWeekdayCalendarUnit) fromDate:date]; +#endif t.tm_wday = [components weekday]; t.tm_year = [components year]; |