NSCalendar: add new NSCalendarUnit definitions

Update NSCalendarUnit definitions with a newer specification from Cocoa.
This commit is contained in:
Daniel Ferreira 2017-06-21 09:14:52 +10:00 committed by Ivan Vučica
parent 959415a236
commit dc88164c94

View file

@ -84,6 +84,8 @@ enum
#endif
typedef NSUInteger NSCalendarUnit;
/* Old-style NSCalendarUnit declarations, deprecated */
enum
{
NSEraCalendarUnit = (1UL << 1),
@ -106,6 +108,33 @@ enum
#endif
};
/* New-style NSCalendarUnit declarations */
enum
{
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
NSCalendarUnitEra = (1UL << 1),
NSCalendarUnitYear = (1UL << 2),
NSCalendarUnitMonth = (1UL << 3),
NSCalendarUnitDay = (1UL << 4),
NSCalendarUnitHour = (1UL << 5),
NSCalendarUnitMinute = (1UL << 6),
NSCalendarUnitSecond = (1UL << 7),
NSCalendarUnitWeekday = (1UL << 9),
NSCalendarUnitWeekdayOrdinal = (1UL << 10),
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
NSCalendarUnitQuarter = (1UL << 11),
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
NSCalendarUnitWeekOfMonth = (1UL << 12),
NSCalendarUnitWeekOfYear = (1UL << 13),
NSCalendarUnitYearForWeekOfYear = (1UL << 14),
NSCalendarUnitNanosecond = (1 << 15), // FIXME: unimplemented
NSCalendarUnitCalendar = (1 << 20), // FIXME: unimplemented
NSCalendarUnitTimeZone = (1 << 21) // FIXME: unimplemented
#endif
};
enum
{
NSWrapCalendarComponents = (1UL << 0)