ICU-22220 adjust #ifndef U_HIDE_DRAFT_API for virtual methods, fix conditionalized enums

This commit is contained in:
Peter Edberg 2023-03-02 15:49:36 -08:00 committed by Peter Edberg
parent bca85d4641
commit 3748ef8f8a
3 changed files with 6 additions and 10 deletions

View file

@ -1349,7 +1349,7 @@ public:
*/
virtual UBool isWeekend(void) const;
#ifndef U_HIDE_DRAFT_API
#ifndef U_FORCE_HIDE_DRAFT_API
/**
* Returns true if the date is in a leap year. Recalculate the current time
* field values if the time value has been changed by a call to * setTime().
@ -1407,7 +1407,7 @@ public:
*/
virtual void setTemporalMonthCode(const char* temporalMonth, UErrorCode& status);
#endif /* U_HIDE_DRAFT_API */
#endif // U_FORCE_HIDE_DRAFT_API
protected:
@ -1549,6 +1549,7 @@ protected:
* @internal
*/
inline int32_t internalGet(UCalendarDateFields field) const {return fFields[field];}
#endif /* U_HIDE_INTERNAL_API */
/**
* Use this function instead of internalGet(UCAL_MONTH). The implementation
@ -1574,8 +1575,6 @@ protected:
*/
virtual int32_t internalGetMonth(int32_t defaultValue) const;
#endif /* U_HIDE_INTERNAL_API */
#ifndef U_HIDE_DEPRECATED_API
/**
* Sets the value for a given time field. This is a fast internal method for

View file

@ -477,7 +477,8 @@ enum UCalendarDateFields {
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
#ifdef U_HIDE_DRAFT_API
UCAL_FIELD_COUNT = UCAL_IS_LEAP_MONTH + 1,
// Must include all fields that will be in structs
UCAL_FIELD_COUNT = UCAL_IS_LEAP_MONTH + 2,
#else // U_HIDE_DRAFT_API (for UCAL_ORDINAL_MONTH)
UCAL_FIELD_COUNT = UCAL_ORDINAL_MONTH + 1,
#endif // U_HIDE_DRAFT_API (for UCAL_ORDINAL_MONTH)

View file

@ -362,11 +362,7 @@ typedef enum UNumberFormatFields {
* One more than the highest normal UNumberFormatFields value.
* @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
*/
#ifndef U_HIDE_DRAFT_API
UNUM_FIELD_COUNT = UNUM_COMPACT_FIELD + 2
#else // U_HIDE_DRAFT_API (for UNUM_APPROXIMATELY_SIGN_FIELD)
UNUM_FIELD_COUNT = UNUM_COMPACT_FIELD + 1
#endif // U_HIDE_DRAFT_API (for UNUM_APPROXIMATELY_SIGN_FIELD)
UNUM_FIELD_COUNT
#endif /* U_HIDE_DEPRECATED_API */
} UNumberFormatFields;