]> granicus.if.org Git - icu/commitdiff
ICU-22220 adjust #ifndef U_HIDE_DRAFT_API for virtual methods, fix conditionalized...
authorPeter Edberg <pedberg@unicode.org>
Thu, 2 Mar 2023 23:49:36 +0000 (15:49 -0800)
committerPeter Edberg <42151464+pedberg-icu@users.noreply.github.com>
Mon, 6 Mar 2023 19:01:50 +0000 (11:01 -0800)
icu4c/source/i18n/unicode/calendar.h
icu4c/source/i18n/unicode/ucal.h
icu4c/source/i18n/unicode/unum.h

index 828962e7f87eb190f3cebec050948c0df6702618..aa83866ac9cc824c2aeab0d1d86a62f74668eba9 100644 (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
index 533e796db574dba430441e9cc5925c09d6c62b74..f428dfcc616032f5320b6446cd8bd75a88c67478 100644 (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)
index 8705133af9b5d3eb69617f86afa31914079f64c0..172ed08964be71e32732855f220319bda8ea8cf1 100644 (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;