From: Peter Edberg Date: Thu, 2 Mar 2023 23:49:36 +0000 (-0800) Subject: ICU-22220 adjust #ifndef U_HIDE_DRAFT_API for virtual methods, fix conditionalized... X-Git-Tag: cldr/2023-03-13~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3748ef8f8adca873fbd2081f0d0435020807ce46;p=icu ICU-22220 adjust #ifndef U_HIDE_DRAFT_API for virtual methods, fix conditionalized enums --- diff --git a/icu4c/source/i18n/unicode/calendar.h b/icu4c/source/i18n/unicode/calendar.h index 828962e7f87..aa83866ac9c 100644 --- a/icu4c/source/i18n/unicode/calendar.h +++ b/icu4c/source/i18n/unicode/calendar.h @@ -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 diff --git a/icu4c/source/i18n/unicode/ucal.h b/icu4c/source/i18n/unicode/ucal.h index 533e796db57..f428dfcc616 100644 --- a/icu4c/source/i18n/unicode/ucal.h +++ b/icu4c/source/i18n/unicode/ucal.h @@ -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) diff --git a/icu4c/source/i18n/unicode/unum.h b/icu4c/source/i18n/unicode/unum.h index 8705133af9b..172ed08964b 100644 --- a/icu4c/source/i18n/unicode/unum.h +++ b/icu4c/source/i18n/unicode/unum.h @@ -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;