]> granicus.if.org Git - icu/commitdiff
ICU-21960 C++20 Warnings from ATOMIC_VAR_INIT
authorAndy Heninger <andy.heninger@gmail.com>
Mon, 16 May 2022 00:15:01 +0000 (17:15 -0700)
committerAndy Heninger <andy.heninger@gmail.com>
Tue, 17 May 2022 22:45:06 +0000 (15:45 -0700)
Remove the ICU macros ATOMIC_INT32_T_INITIALIZER and U_INITONCE_INITIALIZER,
which made use of C++ ATOMIC_VAR_INIT, which has been removed from C++20.

With modern C++ features being available, these macros no longer served
any real need.

65 files changed:
icu4c/source/common/brkiter.cpp
icu4c/source/common/characterproperties.cpp
icu4c/source/common/emojiprops.cpp
icu4c/source/common/loadednormalizer2impl.cpp
icu4c/source/common/locavailable.cpp
icu4c/source/common/locdistance.cpp
icu4c/source/common/locid.cpp
icu4c/source/common/loclikelysubtags.cpp
icu4c/source/common/locutil.cpp
icu4c/source/common/normalizer2.cpp
icu4c/source/common/normalizer2impl.h
icu4c/source/common/putil.cpp
icu4c/source/common/rbbi.cpp
icu4c/source/common/static_unicode_sets.cpp
icu4c/source/common/ucnv_bld.cpp
icu4c/source/common/ucnv_io.cpp
icu4c/source/common/ucurr.cpp
icu4c/source/common/udata.cpp
icu4c/source/common/uinit.cpp
icu4c/source/common/uloc_keytype.cpp
icu4c/source/common/umutex.h
icu4c/source/common/unames.cpp
icu4c/source/common/unifiedcache.cpp
icu4c/source/common/uniset_props.cpp
icu4c/source/common/uprops.cpp
icu4c/source/common/uresbund.cpp
icu4c/source/common/usprep.cpp
icu4c/source/i18n/buddhcal.cpp
icu4c/source/i18n/calendar.cpp
icu4c/source/i18n/chnsecal.cpp
icu4c/source/i18n/coll.cpp
icu4c/source/i18n/collationroot.cpp
icu4c/source/i18n/coptccal.cpp
icu4c/source/i18n/csdetect.cpp
icu4c/source/i18n/dangical.cpp
icu4c/source/i18n/dayperiodrules.cpp
icu4c/source/i18n/dtptngen.cpp
icu4c/source/i18n/ethpccal.cpp
icu4c/source/i18n/gender.cpp
icu4c/source/i18n/gregocal.cpp
icu4c/source/i18n/hebrwcal.cpp
icu4c/source/i18n/indiancal.cpp
icu4c/source/i18n/islamcal.cpp
icu4c/source/i18n/japancal.cpp
icu4c/source/i18n/measunit_extra.cpp
icu4c/source/i18n/number_decimfmtprops.cpp
icu4c/source/i18n/number_modifiers.cpp
icu4c/source/i18n/number_skeletons.cpp
icu4c/source/i18n/numfmt.cpp
icu4c/source/i18n/numsys.cpp
icu4c/source/i18n/olsontz.h
icu4c/source/i18n/persncal.cpp
icu4c/source/i18n/regexst.cpp
icu4c/source/i18n/region.cpp
icu4c/source/i18n/smpdtfst.cpp
icu4c/source/i18n/taiwncal.cpp
icu4c/source/i18n/timezone.cpp
icu4c/source/i18n/tridpars.cpp
icu4c/source/i18n/tzfmt.cpp
icu4c/source/i18n/tznames_impl.cpp
icu4c/source/i18n/ucol_res.cpp
icu4c/source/i18n/uspoof.cpp
icu4c/source/i18n/uspoof_impl.cpp
icu4c/source/i18n/zonemeta.cpp
icu4c/source/io/uprintf.cpp

index 8a1915880ee22980fffa6f49e46134f7e5e06b0f..dae6755441f54b2a6bd51acadd4375ba044d4686 100644 (file)
@@ -279,7 +279,7 @@ ICUBreakIteratorService::~ICUBreakIteratorService() {}
 // defined in ucln_cmn.h
 U_NAMESPACE_END
 
-static icu::UInitOnce gInitOnceBrkiter = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gInitOnceBrkiter {};
 static icu::ICULocaleService* gService = NULL;
 
 
index a2e051a415461fb070e78d59d2138bad9ca2c2d7..15bd92284070c9c1b77fcb4f0e13fd398c2b67b1 100644 (file)
@@ -40,7 +40,7 @@ constexpr int32_t NUM_INCLUSIONS = UPROPS_SRC_COUNT + (UCHAR_INT_LIMIT - UCHAR_I
 
 struct Inclusion {
     UnicodeSet  *fSet = nullptr;
-    UInitOnce    fInitOnce = U_INITONCE_INITIALIZER;
+    UInitOnce    fInitOnce {};
 };
 Inclusion gInclusions[NUM_INCLUSIONS]; // cached getInclusions()
 
index 2a05e8602d3c0c90be65b7e08b0a64e211018f9c..d07e07c6ccc79ad36f5c3fab1d54d078d451d943 100644 (file)
@@ -22,7 +22,7 @@ U_NAMESPACE_BEGIN
 namespace {
 
 EmojiProps *singleton = nullptr;
-icu::UInitOnce emojiInitOnce = U_INITONCE_INITIALIZER;
+icu::UInitOnce emojiInitOnce {};
 
 UBool U_CALLCONV emojiprops_cleanup() {
     delete singleton;
index 905fc1deccb9740cb4d34beeb8541c518bcfee52..ef3a0c6a50daa41710b13d605b6405e48b86d07b 100644 (file)
@@ -134,14 +134,14 @@ U_CDECL_END
 
 #if !NORM2_HARDCODE_NFC_DATA
 static Norm2AllModes *nfcSingleton;
-static icu::UInitOnce nfcInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce nfcInitOnce {};
 #endif
 
 static Norm2AllModes *nfkcSingleton;
-static icu::UInitOnce nfkcInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce nfkcInitOnce {};
 
 static Norm2AllModes *nfkc_cfSingleton;
-static icu::UInitOnce nfkc_cfInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce nfkc_cfInitOnce {};
 
 static UHashtable    *cache=NULL;
 
index e8ec512e370992777ec493d15f95448684d3442e..8fe74ea1fb8f4377156f3c3f5fef2875f660cf44 100644 (file)
@@ -37,7 +37,7 @@ U_NAMESPACE_BEGIN
 
 static icu::Locale*  availableLocaleList = NULL;
 static int32_t  availableLocaleListCount;
-static icu::UInitOnce gInitOnceLocale = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gInitOnceLocale {};
 
 U_NAMESPACE_END
 
@@ -102,7 +102,7 @@ namespace {
 // Enough capacity for the two lists in the res_index.res file
 const char** gAvailableLocaleNames[2] = {};
 int32_t gAvailableLocaleCounts[2] = {};
-icu::UInitOnce ginstalledLocalesInitOnce = U_INITONCE_INITIALIZER;
+icu::UInitOnce ginstalledLocalesInitOnce {};
 
 class AvailableLocalesSink : public ResourceSink {
   public:
index ff8892791b2d988ea50606df891b8277e4586b61..0f649679d8d788513f5152268fe6607e06eaa12a 100644 (file)
@@ -45,7 +45,7 @@ enum {
 };
 
 LocaleDistance *gLocaleDistance = nullptr;
-UInitOnce gInitOnce = U_INITONCE_INITIALIZER;
+UInitOnce gInitOnce {};
 
 UBool U_CALLCONV cleanup() {
     delete gLocaleDistance;
index 96d3851804d1e1355e8d733330878213c5b7ea72..876cdc47cf592cdd11e76691147e0766bee11dfe 100644 (file)
@@ -64,7 +64,7 @@ U_CDECL_END
 U_NAMESPACE_BEGIN
 
 static Locale   *gLocaleCache = NULL;
-static UInitOnce gLocaleCacheInitOnce = U_INITONCE_INITIALIZER;
+static UInitOnce gLocaleCacheInitOnce {};
 
 // gDefaultLocaleMutex protects all access to gDefaultLocalesHashT and gDefaultLocale.
 static UMutex gDefaultLocaleMutex;
@@ -491,7 +491,7 @@ Locale::operator==( const   Locale& other) const
 
 namespace {
 
-UInitOnce gKnownCanonicalizedInitOnce = U_INITONCE_INITIALIZER;
+UInitOnce gKnownCanonicalizedInitOnce {};
 UHashtable *gKnownCanonicalized = nullptr;
 
 static const char* const KNOWN_CANONICALIZED[] = {
@@ -682,7 +682,7 @@ private:
 
 
 const AliasData* AliasData::gSingleton = nullptr;
-UInitOnce AliasData::gInitOnce = U_INITONCE_INITIALIZER;
+UInitOnce AliasData::gInitOnce {};
 
 UBool U_CALLCONV
 AliasData::cleanup()
index aa592e6ea807319a8439adb599604be9450038d4..fcf10b0b4310192649c8f7a2de3a541b5f326399 100644 (file)
@@ -245,7 +245,7 @@ private:
 namespace {
 
 XLikelySubtags *gLikelySubtags = nullptr;
-UInitOnce gInitOnce = U_INITONCE_INITIALIZER;
+UInitOnce gInitOnce {};
 
 UBool U_CALLCONV cleanup() {
     delete gLikelySubtags;
index 3d9d69ff7ed0e228951c81b00f0acfaf992d0385..52b5f7ab1dfa5367b6c131ef7e74228d10af7d40 100644 (file)
@@ -21,7 +21,7 @@
 #include "umutex.h"
 
 // see LocaleUtility::getAvailableLocaleNames
-static icu::UInitOnce   LocaleUtilityInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce   LocaleUtilityInitOnce {};
 static icu::Hashtable * LocaleUtility_cache = NULL;
 
 #define UNDERSCORE_CHAR ((UChar)0x005f)
index 6be7e0b21a2bf9ec31cf3e2767e6d2511fc04292..36ad5b8b0cfd0ca4fe741716a547bdbad4305aac 100644 (file)
@@ -183,7 +183,7 @@ static UBool U_CALLCONV uprv_normalizer2_cleanup();
 U_CDECL_END
 
 static Normalizer2   *noopSingleton;
-static icu::UInitOnce noopInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce noopInitOnce {};
 
 static void U_CALLCONV initNoopSingleton(UErrorCode &errorCode) {
     if(U_FAILURE(errorCode)) {
@@ -245,7 +245,7 @@ Norm2AllModes::createNFCInstance(UErrorCode &errorCode) {
 
 static Norm2AllModes *nfcSingleton;
 
-static icu::UInitOnce nfcInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce nfcInitOnce {};
 
 static void U_CALLCONV initNFCSingleton(UErrorCode &errorCode) {
     nfcSingleton=Norm2AllModes::createNFCInstance(errorCode);
index 7c85448b71bc056dbc6d10afee20d756dc38a58b..5c971772c0726550a15efa6aeca9b16c0e5415df 100644 (file)
@@ -730,7 +730,7 @@ private:
     const uint16_t *extraData;  // mappings and/or compositions for yesYes, yesNo & noNo characters
     const uint8_t *smallFCD;  // [0x100] one bit per 32 BMP code points, set if any FCD!=0
 
-    UInitOnce       fCanonIterDataInitOnce = U_INITONCE_INITIALIZER;
+    UInitOnce       fCanonIterDataInitOnce {};
     CanonIterData  *fCanonIterData;
 };
 
index 68be079b3a3c0eff4643de9051de1297c50379dd..41f6e3c66b7866606f1e3126d65e92e0f678348e 100644 (file)
@@ -1260,10 +1260,10 @@ uprv_tzname(int n)
 
 /* Get and set the ICU data directory --------------------------------------- */
 
-static icu::UInitOnce gDataDirInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gDataDirInitOnce {};
 static char *gDataDirectory = NULL;
 
-UInitOnce gTimeZoneFilesInitOnce = U_INITONCE_INITIALIZER;
+UInitOnce gTimeZoneFilesInitOnce {};
 static CharString *gTimeZoneFilesDirectory = NULL;
 
 #if U_POSIX_LOCALE || U_PLATFORM_USES_ONLY_WIN32_API
index cae8d154b30802c16abd83fbb144f3075f8d4acc..acc1f5b349a550d3ede85604f616770f79633bc9 100644 (file)
@@ -1153,8 +1153,8 @@ U_NAMESPACE_END
 
 static icu::UStack *gLanguageBreakFactories = nullptr;
 static const icu::UnicodeString *gEmptyString = nullptr;
-static icu::UInitOnce gLanguageBreakFactoriesInitOnce = U_INITONCE_INITIALIZER;
-static icu::UInitOnce gRBBIInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gLanguageBreakFactoriesInitOnce {};
+static icu::UInitOnce gRBBIInitOnce {};
 
 /**
  * Release all static memory held by breakiterator.
index 5dab3931a707fdd7b44e8d7f1977e674051a6eea..f0f222cd37849d1ce251f47546322bc1ee87ab2f 100644 (file)
@@ -129,7 +129,7 @@ class ParseDataSink : public ResourceSink {
 };
 
 
-icu::UInitOnce gNumberParseUniSetsInitOnce = U_INITONCE_INITIALIZER;
+icu::UInitOnce gNumberParseUniSetsInitOnce {};
 
 UBool U_CALLCONV cleanupNumberParseUniSets() {
     if (gEmptyUnicodeSetInitialized) {
index d08eec73696f942443e1028d2839f5943709926f..548fae83d4e5dd6f1ad504b06af2966c2b2376b6 100644 (file)
@@ -200,7 +200,7 @@ static icu::UMutex cnvCacheMutex;
 
 static const char **gAvailableConverters = NULL;
 static uint16_t gAvailableConverterCount = 0;
-static icu::UInitOnce gAvailableConvertersInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gAvailableConvertersInitOnce {};
 
 #if !U_CHARSET_IS_UTF8
 
index 7a95a3f1e61dd7c06d53384d71de29b9ad1f6d85..6d8258ce3474bdf7e0b5eaf74afac6e18fc563ff 100644 (file)
@@ -175,7 +175,7 @@ static const char DATA_NAME[] = "cnvalias";
 static const char DATA_TYPE[] = "icu";
 
 static UDataMemory *gAliasData=NULL;
-static icu::UInitOnce gAliasDataInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gAliasDataInitOnce {};
 
 enum {
     tocLengthIndex=0,
index 6e489e0563d41675639a0627a4487fb50d397cc1..2d7cb7ad0c88b35f54847e512cf5ed9d12b924bd 100644 (file)
@@ -97,11 +97,11 @@ static const char CURRENCYPLURALS[] = "CurrencyPlurals";
 
 // ISO codes mapping table
 static const UHashtable* gIsoCodes = NULL;
-static icu::UInitOnce gIsoCodesInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gIsoCodesInitOnce {};
 
 // Currency symbol equivalances
 static const icu::Hashtable* gCurrSymbolsEquiv = NULL;
-static icu::UInitOnce gCurrSymbolsEquivInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gCurrSymbolsEquivInitOnce {};
 
 U_NAMESPACE_BEGIN
 
index ec9c999cea41a6e4c2ab27cf2e6d07e35c43b189..87bb855dda044095554c6b8d6dafe923bb81a169 100644 (file)
@@ -106,10 +106,10 @@ static UDataMemory *udata_findCachedData(const char *path, UErrorCode &err);
  */
 static UDataMemory *gCommonICUDataArray[10] = { NULL };   // Access protected by icu global mutex.
 
-static u_atomic_int32_t gHaveTriedToLoadCommonData = ATOMIC_INT32_T_INITIALIZER(0);  //  See extendICUData().
+static u_atomic_int32_t gHaveTriedToLoadCommonData {0};  //  See extendICUData().
 
 static UHashtable  *gCommonDataCache = NULL;  /* Global hash table of opened ICU data files.  */
-static icu::UInitOnce gCommonDataCacheInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gCommonDataCacheInitOnce {};
 
 #if !defined(ICU_DATA_DIR_WINDOWS)
 static UDataFileAccess  gDataFileAccess = UDATA_DEFAULT_ACCESS;  // Access not synchronized.
index 624431be02c713845777c1e082514b788691047a..fa534e92c616fdf4851429c18bef378869f4db80 100644 (file)
@@ -26,7 +26,7 @@
 
 U_NAMESPACE_BEGIN
 
-static UInitOnce gICUInitOnce = U_INITONCE_INITIALIZER;
+static UInitOnce gICUInitOnce {};
 
 static UBool U_CALLCONV uinit_cleanup() {
     gICUInitOnce.reset();
index 580244124ee364fc29f5bf25ec8d5724713d0384..ea9b90301fe121b2a8c38910d2ffdf31bbdf77fa 100644 (file)
@@ -24,7 +24,7 @@
 #include "udataswp.h" /* for InvChar functions */
 
 static UHashtable* gLocExtKeyMap = NULL;
-static icu::UInitOnce gLocExtKeyMapInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gLocExtKeyMapInitOnce {};
 
 // bit flags for special types
 typedef enum {
index 8d76b3f3e6f59628779774cbb993307655b2729b..1b8332409c6dda72c4f09dbe5a88218d9a8bfdf0 100644 (file)
@@ -71,7 +71,6 @@ U_NAMESPACE_BEGIN
  ****************************************************************************/
 
 typedef std::atomic<int32_t> u_atomic_int32_t;
-#define ATOMIC_INT32_T_INITIALIZER(val) ATOMIC_VAR_INIT(val)
 
 inline int32_t umtx_loadAcquire(u_atomic_int32_t &var) {
     return var.load(std::memory_order_acquire);
@@ -96,18 +95,15 @@ inline int32_t umtx_atomic_dec(u_atomic_int32_t *var) {
  *
  *************************************************************************************************/
 
-struct UInitOnce {
-    u_atomic_int32_t   fState;
-    UErrorCode       fErrCode;
+struct U_COMMON_API UInitOnce {
+    u_atomic_int32_t   fState {0};
+    UErrorCode       fErrCode {U_ZERO_ERROR};
     void reset() {fState = 0;}
     UBool isReset() {return umtx_loadAcquire(fState) == 0;}
 // Note: isReset() is used by service registration code.
 //                 Thread safety of this usage needs review.
 };
 
-#define U_INITONCE_INITIALIZER {ATOMIC_INT32_T_INITIALIZER(0), U_ZERO_ERROR}
-
-
 U_COMMON_API UBool U_EXPORT2 umtx_initImplPreInit(UInitOnce &);
 U_COMMON_API void  U_EXPORT2 umtx_initImplPostInit(UInitOnce &);
 
index 5776058f957f40f8762474be06de08104730de4c..e5233b8518eeaa17fcad8a5119e4ef9e60210111 100644 (file)
@@ -105,7 +105,7 @@ typedef struct {
 
 static UDataMemory *uCharNamesData=NULL;
 static UCharNames *uCharNames=NULL;
-static icu::UInitOnce gCharNamesInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gCharNamesInitOnce {};
 
 /*
  * Maximum length of character names (regular & 1.0).
index 493ab79f6d9067e2e90e2dbf20dc41a6d24fae18..bf83e97554f0cfed8e10656f9267432082c84a54 100644 (file)
@@ -22,7 +22,7 @@
 static icu::UnifiedCache *gCache = NULL;
 static std::mutex *gCacheMutex = nullptr;
 static std::condition_variable *gInProgressValueAddedCond;
-static icu::UInitOnce gCacheInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gCacheInitOnce {};
 
 static const int32_t MAX_EVICT_ITERATIONS = 10;
 static const int32_t DEFAULT_MAX_UNUSED = 1000;
index 49d6caabc7557e5b79a9687693334f268bd6b120..80f8e0f8501344fcb064f8ce7add670d4b681f89 100644 (file)
@@ -62,7 +62,7 @@ U_CDECL_BEGIN
 static UBool U_CALLCONV uset_cleanup();
 
 static UnicodeSet *uni32Singleton;
-static icu::UInitOnce uni32InitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce uni32InitOnce {};
 
 /**
  * Cleanup function for UnicodeSet
index 5186a0c75caf6be4c0abdbfd581a1801c9500033..a878a9c5367c2975f38a501edc48b25690bac93a 100644 (file)
@@ -49,7 +49,7 @@ U_NAMESPACE_USE
 
 namespace {
 
-icu::UInitOnce gLayoutInitOnce = U_INITONCE_INITIALIZER;
+icu::UInitOnce gLayoutInitOnce {};
 UDataMemory *gLayoutMemory = nullptr;
 
 UCPTrie *gInpcTrie = nullptr;  // Indic_Positional_Category
index a9c6459418cacbc4f6e97863cc3c5b5b76928d13..bbf45538d872b732da44d6cdf214e9cd0685fa3c 100644 (file)
@@ -49,7 +49,7 @@ TODO: This cache should probably be removed when the deprecated code is
       completely removed.
 */
 static UHashtable *cache = NULL;
-static icu::UInitOnce gCacheInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gCacheInitOnce {};
 
 static UMutex resbMutex;
 
index 41a1f56c773f5b3b201cb385fef8f4fab3e844a3..bdb352dac943efcba5046afa4b71e59a695079ee 100644 (file)
@@ -45,7 +45,7 @@ U_CDECL_BEGIN
 Static cache for already opened StringPrep profiles
 */
 static UHashtable *SHARED_DATA_HASHTABLE = NULL;
-static icu::UInitOnce gSharedDataInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gSharedDataInitOnce {};
 
 static UMutex usprepMutex;
 /* format version of spp file */
index 6083349ecd623a70260a1c82377a2cbf1afae0d8..4b75b5e02cb149b1e490dee3a1d2cf5cc19961d2 100644 (file)
@@ -133,7 +133,7 @@ void BuddhistCalendar::timeToFields(UDate theTime, UBool quick, UErrorCode& stat
  */
 static UDate     gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t   gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce gBCInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gBCInitOnce {};
 
 
 UBool BuddhistCalendar::haveDefaultCentury() const
index 8405d08d3cfce7bb1d87488a30b42913d0530e3f..233400be70d59f00a278972a737b69f4d179b449 100644 (file)
@@ -65,7 +65,7 @@
 
 #if !UCONFIG_NO_SERVICE
 static icu::ICULocaleService* gService = NULL;
-static icu::UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gServiceInitOnce {};
 
 // INTERNAL - for cleanup
 U_CDECL_BEGIN
index f8fb4a40f1427c2363f143e87533a48d56e11d05..a58272e8a56a6941ad44e5a3b1c3dd34afbaa8e4 100644 (file)
@@ -59,7 +59,7 @@ static icu::CalendarCache *gChineseCalendarWinterSolsticeCache = NULL;
 static icu::CalendarCache *gChineseCalendarNewYearCache = NULL;
 
 static icu::TimeZone *gChineseCalendarZoneAstroCalc = NULL;
-static icu::UInitOnce gChineseCalendarZoneAstroCalcInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gChineseCalendarZoneAstroCalcInitOnce {};
 
 /**
  * The start year of the Chinese calendar, the 61st year of the reign
@@ -843,7 +843,7 @@ ChineseCalendar::inDaylightTime(UErrorCode& status) const
 
 static UDate     gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t   gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce gSystemDefaultCenturyInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gSystemDefaultCenturyInitOnce {};
 
 
 UBool ChineseCalendar::haveDefaultCentury() const
index 7bdd80f3c74722a22660ee3edaadd155113c3154..d14f76c8acf72fd7d2c6184bddd94f09f2fca5ed 100644 (file)
@@ -65,9 +65,9 @@ static icu::Locale* availableLocaleList = NULL;
 static int32_t  availableLocaleListCount;
 #if !UCONFIG_NO_SERVICE
 static icu::ICULocaleService* gService = NULL;
-static icu::UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gServiceInitOnce {};
 #endif
-static icu::UInitOnce gAvailableLocaleListInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gAvailableLocaleListInitOnce {};
 
 /**
  * Release all static memory held by collator.
index 71753bd6f4bf20ab4c40d247bef20d0c0d98030d..3f262920444676c46429ca8b4b12196f4ee35779 100644 (file)
@@ -33,7 +33,7 @@ U_NAMESPACE_BEGIN
 namespace {
 
 static const CollationCacheEntry *rootSingleton = NULL;
-static UInitOnce initOnce = U_INITONCE_INITIALIZER;
+static UInitOnce initOnce {};
 
 }  // namespace
 
index 9c2b1ebbb7ffdb0829a2aec9559d5cdf3f5906e5..0be700ca0138d7a474bc22e3a8bdcffbe0ab0eb1 100644 (file)
@@ -103,7 +103,7 @@ CopticCalendar::handleComputeFields(int32_t julianDay, UErrorCode &/*status*/)
  */
 static UDate           gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t         gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce  gSystemDefaultCenturyInit        = U_INITONCE_INITIALIZER;
+static icu::UInitOnce  gSystemDefaultCenturyInit        {};
 
 
 static void U_CALLCONV initializeSystemDefaultCentury() {
index d866eb66286811399e6fbad58f979e2dcd073eb5..29a0aded8224fa5889fa75b6a6ab480616ea411d 100644 (file)
@@ -47,7 +47,7 @@ struct CSRecognizerInfo : public UMemory {
 U_NAMESPACE_END
 
 static icu::CSRecognizerInfo **fCSRecognizers = NULL;
-static icu::UInitOnce gCSRecognizersInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gCSRecognizersInitOnce {};
 static int32_t fCSRecognizers_size = 0;
 
 U_CDECL_BEGIN
index 57fe80220b9ab67f5ecdf71033b1a7e4907db4c8..e16174cb5a97d3f228a8f61316bc8a676bf316ba 100644 (file)
@@ -24,7 +24,7 @@
 
 // --- The cache --
 static icu::TimeZone *gDangiCalendarZoneAstroCalc = NULL;
-static icu::UInitOnce gDangiCalendarInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gDangiCalendarInitOnce {};
 
 /**
  * The start year of the Korean traditional calendar (Dan-gi) is the inaugural
index efe92dd794b64237252a77f2b13f372c8af05f14..24d3afdbe54981448f73badb0517dc6a11934a8b 100644 (file)
@@ -301,7 +301,7 @@ DayPeriodRulesCountSink::~DayPeriodRulesCountSink() {}
 
 namespace {
 
-UInitOnce initOnce = U_INITONCE_INITIALIZER;
+UInitOnce initOnce {};
 
 U_CFUNC UBool U_CALLCONV dayPeriodRulesCleanup() {
     delete[] data->rules;
index e781c6e26f5fcbbb94c4eb6c1e38eecb52a416bb..a029b2aadfefdf6424cd5e1281dc24f3eb81f9dd 100644 (file)
@@ -473,7 +473,7 @@ DateTimePatternGenerator::~DateTimePatternGenerator() {
 
 namespace {
 
-UInitOnce initOnce = U_INITONCE_INITIALIZER;
+UInitOnce initOnce {};
 UHashtable *localeToAllowedHourFormatsMap = nullptr;
 
 // Value deleter for hashmap.
index 7c7c0ba37b7f693f267921fa7d481e6f07256bfc..07937872242c1adc7c8bb43138cba00913b56f4d 100644 (file)
@@ -143,7 +143,7 @@ EthiopicCalendar::handleGetLimit(UCalendarDateFields field, ELimitType limitType
  */
 static UDate           gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t         gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce  gSystemDefaultCenturyInit        = U_INITONCE_INITIALIZER;
+static icu::UInitOnce  gSystemDefaultCenturyInit        {};
 
 static void U_CALLCONV initializeSystemDefaultCentury()
 {
index dc5def6ad350974267337344073cbf9c2e49479e..0fe674fc7d16800d5dd8c794d394473fa7dd0a81 100644 (file)
@@ -37,7 +37,7 @@ static const char* gNeutralStr = "neutral";
 static const char* gMailTaintsStr = "maleTaints";
 static const char* gMixedNeutralStr = "mixedNeutral";
 static icu::GenderInfo* gObjs = NULL;
-static icu::UInitOnce gGenderInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gGenderInitOnce {};
 
 enum GenderStyle {
   NEUTRAL,
index 31d36300aeb092fa9fa596f940f818676aeb4c76..6e26ed83c6281693442a4aa0de6c2d84bc8f1514 100644 (file)
@@ -1274,7 +1274,7 @@ GregorianCalendar::getType() const {
  */
 static UDate           gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t         gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce  gSystemDefaultCenturyInit        = U_INITONCE_INITIALIZER;
+static icu::UInitOnce  gSystemDefaultCenturyInit        {};
 
 
 UBool GregorianCalendar::haveDefaultCentury() const
index 4d8e59cef95a4133246e11e42f2db67d51f3cb31..770634d6750bcb15cd31ad9530fcc784e66c7fe2 100644 (file)
@@ -686,7 +686,7 @@ HebrewCalendar::inDaylightTime(UErrorCode& status) const
  */
 static UDate           gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t         gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce  gSystemDefaultCenturyInit        = U_INITONCE_INITIALIZER;
+static icu::UInitOnce  gSystemDefaultCenturyInit        {};
 
 UBool HebrewCalendar::haveDefaultCentury() const
 {
index 7bba7f5092059f10b18b4f2aafebd034bcfc74b0..e879cdf183aa8be3baef4948f05eb93eaae77773 100644 (file)
@@ -320,7 +320,7 @@ IndianCalendar::inDaylightTime(UErrorCode& status) const
  */
 static UDate           gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t         gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce  gSystemDefaultCenturyInit        = U_INITONCE_INITIALIZER;
+static icu::UInitOnce  gSystemDefaultCenturyInit        {};
 
 
 UBool IndianCalendar::haveDefaultCentury() const
index de37e6b9398613bbc2d9a1a33561628d10558705..d44bdcdeba3347e338d082b27a6166d5fcdd6eac 100644 (file)
@@ -712,7 +712,7 @@ IslamicCalendar::inDaylightTime(UErrorCode& status) const
  */
 static UDate           gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t         gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce  gSystemDefaultCenturyInit        = U_INITONCE_INITIALIZER;
+static icu::UInitOnce  gSystemDefaultCenturyInit        {};
 
 
 UBool IslamicCalendar::haveDefaultCentury() const
index 75a248f406ffe1c74699e77d24a7f48273a05848..be9e53ff77bc8c86b5d30535a979190fa1d6158c 100644 (file)
@@ -39,7 +39,7 @@
 #include "cstring.h"
 
 static icu::EraRules * gJapaneseEraRules = nullptr;
-static icu::UInitOnce gJapaneseEraRulesInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gJapaneseEraRulesInitOnce {};
 static int32_t gCurrentEra = 0;
 
 U_CDECL_BEGIN
index 2df9edee96a8a6f97b53b148adf653dd559781aa..57eb25b9cc5a0e81ad4c72b1ff8f9ff71936fa25 100644 (file)
@@ -312,7 +312,7 @@ class CategoriesSink : public icu::ResourceSink {
     int32_t outIndex;
 };
 
-icu::UInitOnce gUnitExtrasInitOnce = U_INITONCE_INITIALIZER;
+icu::UInitOnce gUnitExtrasInitOnce {};
 
 // Array of simple unit IDs.
 //
index 7fa58bbc7ab66cae1dccd17740e09f40b4778262..6dbfc69ec83cd0430ed341ee0716e86b5f5f5816 100644 (file)
@@ -18,7 +18,7 @@ namespace {
 alignas(DecimalFormatProperties)
 char kRawDefaultProperties[sizeof(DecimalFormatProperties)];
 
-icu::UInitOnce gDefaultPropertiesInitOnce = U_INITONCE_INITIALIZER;
+icu::UInitOnce gDefaultPropertiesInitOnce {};
 
 void U_CALLCONV initDefaultProperties(UErrorCode&) {
     // can't fail, uses placement new into statically allocated space.
index b74bfd06fc8e76bd9fdc070f804190ac7814bb4d..50f5e97cb91d9c523dfe0dd0ca161c5187576c1c 100644 (file)
@@ -22,7 +22,7 @@ const int32_t ARG_NUM_LIMIT = 0x100;
 // These are the default currency spacing UnicodeSets in CLDR.
 // Pre-compute them for performance.
 // The Java unit test testCurrencySpacingPatternStability() will start failing if these change in CLDR.
-icu::UInitOnce gDefaultCurrencySpacingInitOnce = U_INITONCE_INITIALIZER;
+icu::UInitOnce gDefaultCurrencySpacingInitOnce {};
 
 UnicodeSet *UNISET_DIGIT = nullptr;
 UnicodeSet *UNISET_NOTSZ = nullptr;
index c51831b682380977e3660f1d6d824cb13d5ad128..6a1572ad0b4db77743714fba2c1364e52eeb6b45 100644 (file)
@@ -33,7 +33,7 @@ using namespace icu::number::impl::skeleton;
 
 namespace {
 
-icu::UInitOnce gNumberSkeletonsInitOnce = U_INITONCE_INITIALIZER;
+icu::UInitOnce gNumberSkeletonsInitOnce {};
 
 char16_t* kSerializedStemTrie = nullptr;
 
index b8ce1c930f9dbe412a9d3f49a5319121dde3d81f..8c90fdd5b761877508668be7f70c54cb76b221dd 100644 (file)
@@ -156,11 +156,11 @@ static const icu::number::impl::CldrPatternStyle gFormatCldrStyles[UNUM_FORMAT_S
 
 // Static hashtable cache of NumberingSystem objects used by NumberFormat
 static UHashtable * NumberingSystem_cache = NULL;
-static icu::UInitOnce gNSCacheInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gNSCacheInitOnce {};
 
 #if !UCONFIG_NO_SERVICE
 static icu::ICULocaleService* gService = NULL;
-static icu::UInitOnce gServiceInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gServiceInitOnce {};
 #endif
 
 /**
index 934149039c52d7365dcca90054d4431fb13bd78e..250349393e4fe62f57a417f8c15c67e8fb3f4e78 100644 (file)
@@ -271,7 +271,7 @@ UBool NumberingSystem::isAlgorithmic() const {
 namespace {
 
 UVector* gNumsysNames = nullptr;
-UInitOnce gNumSysInitOnce = U_INITONCE_INITIALIZER;
+UInitOnce gNumSysInitOnce {};
 
 U_CFUNC UBool U_CALLCONV numSysCleanup() {
     delete gNumsysNames;
index 75d86781edd49a5060be65822967b408593a8663..525bbd2b129ccd382bd0b4983399e78e839ff0d8 100644 (file)
@@ -400,7 +400,7 @@ private:
     TimeArrayTimeZoneRule   **historicRules;
     int16_t             historicRuleCount;
     SimpleTimeZone      *finalZoneWithStartYear; // hack
-    UInitOnce           transitionRulesInitOnce = U_INITONCE_INITIALIZER;
+    UInitOnce           transitionRulesInitOnce {};
 };
 
 inline int16_t
index d30577f337f79cfa18171b64b81033c9112e909f..873f4e5878427f38adcab420446a787b57723463 100644 (file)
@@ -250,7 +250,7 @@ PersianCalendar::inDaylightTime(UErrorCode& status) const
 
 static UDate           gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t         gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce  gSystemDefaultCenturyInit        = U_INITONCE_INITIALIZER;
+static icu::UInitOnce  gSystemDefaultCenturyInit        {};
 
 UBool PersianCalendar::haveDefaultCentury() const
 {
index 97e417ab5a8f34419a4458b4662387354293ac38..b014013780aa3a5b2bad4af27a0f8c75782c8661 100644 (file)
@@ -69,7 +69,7 @@ constexpr char16_t const *gGC_LVTPattern     = u"[\\p{Hangul_Syllable_Type=LVT}]
 
 
 RegexStaticSets *RegexStaticSets::gStaticSets = nullptr;
-UInitOnce gStaticSetsInitOnce = U_INITONCE_INITIALIZER;
+UInitOnce gStaticSetsInitOnce {};
 
 
 RegexStaticSets::RegexStaticSets(UErrorCode *status) {
index 277a22fd091cfb094597bce7dbdf50b63c0f3cbc..70d88974b249ddf917889dee7b54660d032b9044 100644 (file)
@@ -53,7 +53,7 @@ U_CDECL_END
 
 U_NAMESPACE_BEGIN
 
-static UInitOnce gRegionDataInitOnce = U_INITONCE_INITIALIZER;
+static UInitOnce gRegionDataInitOnce {};
 static UVector* availableRegions[URGN_LIMIT];
 
 static UHashtable *regionAliases = NULL;
index db59a4b4ab7f8f925064ae1c2e5cdb9e2f5e0d17..2c8278df23681f3b5ded0bbf02129d417d08dec8 100644 (file)
@@ -30,7 +30,7 @@
 U_NAMESPACE_BEGIN
 
 SimpleDateFormatStaticSets *gStaticSets = NULL;
-UInitOnce gSimpleDateFormatStaticSetsInitOnce = U_INITONCE_INITIALIZER;
+UInitOnce gSimpleDateFormatStaticSetsInitOnce {};
 
 SimpleDateFormatStaticSets::SimpleDateFormatStaticSets(UErrorCode &status)
 : fDateIgnorables(NULL),
index 27352aa10c32b2d967ceda9e047e3066776f3dae..c790605ed3a6538a2d823496e79a3a63f58a738e 100644 (file)
@@ -140,7 +140,7 @@ void TaiwanCalendar::timeToFields(UDate theTime, UBool quick, UErrorCode& status
  */
 static UDate           gSystemDefaultCenturyStart       = DBL_MIN;
 static int32_t         gSystemDefaultCenturyStartYear   = -1;
-static icu::UInitOnce  gSystemDefaultCenturyInit        = U_INITONCE_INITIALIZER;
+static icu::UInitOnce  gSystemDefaultCenturyInit        {};
 
 UBool TaiwanCalendar::haveDefaultCentury() const
 {
index 8115a45e0ac4d16ac31ffd3a0fc6462af76bf308..a0bc7460160d34a1436946315447423d51384100 100644 (file)
@@ -113,7 +113,7 @@ static const int32_t       GMT_ID_LENGTH = 3;
 static const int32_t       UNKNOWN_ZONE_ID_LENGTH = 11;
 
 static icu::TimeZone* DEFAULT_ZONE = NULL;
-static icu::UInitOnce gDefaultZoneInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gDefaultZoneInitOnce {};
 
 alignas(icu::SimpleTimeZone)
 static char gRawGMT[sizeof(icu::SimpleTimeZone)];
@@ -121,11 +121,11 @@ static char gRawGMT[sizeof(icu::SimpleTimeZone)];
 alignas(icu::SimpleTimeZone)
 static char gRawUNKNOWN[sizeof(icu::SimpleTimeZone)];
 
-static icu::UInitOnce gStaticZonesInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gStaticZonesInitOnce {};
 static UBool gStaticZonesInitialized = FALSE; // Whether the static zones are initialized and ready to use.
 
 static char TZDATA_VERSION[16];
-static icu::UInitOnce gTZDataVersionInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gTZDataVersionInitOnce {};
 
 static int32_t* MAP_SYSTEM_ZONES = NULL;
 static int32_t* MAP_CANONICAL_SYSTEM_ZONES = NULL;
@@ -135,9 +135,9 @@ static int32_t LEN_SYSTEM_ZONES = 0;
 static int32_t LEN_CANONICAL_SYSTEM_ZONES = 0;
 static int32_t LEN_CANONICAL_SYSTEM_LOCATION_ZONES = 0;
 
-static icu::UInitOnce gSystemZonesInitOnce = U_INITONCE_INITIALIZER;
-static icu::UInitOnce gCanonicalZonesInitOnce = U_INITONCE_INITIALIZER;
-static icu::UInitOnce gCanonicalLocationZonesInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gSystemZonesInitOnce {};
+static icu::UInitOnce gCanonicalZonesInitOnce {};
+static icu::UInitOnce gCanonicalLocationZonesInitOnce {};
 
 U_CDECL_BEGIN
 static UBool U_CALLCONV timeZone_cleanup(void)
index 0ca168e7a3e30b7cb8594565333f79de6376ef0f..873a159f76661ae16af42fe65019117073e383bb 100644 (file)
@@ -45,7 +45,7 @@ static const int32_t FORWARD = UTRANS_FORWARD;
 static const int32_t REVERSE = UTRANS_REVERSE;
 
 static Hashtable* SPECIAL_INVERSES = NULL;
-static UInitOnce gSpecialInversesInitOnce = U_INITONCE_INITIALIZER;
+static UInitOnce gSpecialInversesInitOnce {};
 
 /**
  * The mutex controlling access to SPECIAL_INVERSES
index 9d046c30c8f07bef560a02914e034d855e9615ae..2d08193f2684561aeda0c759ab267085a49be729 100644 (file)
@@ -145,10 +145,10 @@ static const int32_t ALL_GENERIC_NAME_TYPES = UTZGNM_LOCATION | UTZGNM_LONG | UT
 
 // Time Zone ID/Short ID trie
 static TextTrieMap *gZoneIdTrie = NULL;
-static icu::UInitOnce gZoneIdTrieInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gZoneIdTrieInitOnce {};
 
 static TextTrieMap *gShortZoneIdTrie = NULL;
-static icu::UInitOnce gShortZoneIdTrieInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gShortZoneIdTrieInitOnce {};
 
 static UMutex gLock;
 
index 69991dfef4b5c022a3b3ecada673aba5c13cdff9..dcddafcd7540f8328f87c31bb78b4d67d34b7f32 100644 (file)
@@ -55,10 +55,10 @@ static const int32_t TZDBNAMES_KEYS_SIZE = UPRV_LENGTHOF(TZDBNAMES_KEYS);
 static UMutex gDataMutex;
 
 static UHashtable* gTZDBNamesMap = NULL;
-static icu::UInitOnce gTZDBNamesMapInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gTZDBNamesMapInitOnce {};
 
 static TextTrieMap* gTZDBNamesTrie = NULL;
-static icu::UInitOnce gTZDBNamesTrieInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gTZDBNamesTrieInitOnce {};
 
 // The order in which strings are stored may be different than the order in the public enum.
 enum UTimeZoneNameTypeIndex {
index b277cf3b280a5f2122ef1d14c3ad0466786430ca..65cc5e19bd97ceb9a799e1bc9b40da14aaa5ec3a 100644 (file)
@@ -62,7 +62,7 @@ namespace {
 static const UChar *rootRules = NULL;
 static int32_t rootRulesLength = 0;
 static UResourceBundle *rootBundle = NULL;
-static UInitOnce gInitOnceUcolRes = U_INITONCE_INITIALIZER;
+static UInitOnce gInitOnceUcolRes {};
 
 }  // namespace
 
index dd4618baa703cb60bc81299ea80a38342dc62adf..a05426ab580d34e858f4b6308731fa41e13b4974 100644 (file)
@@ -41,7 +41,7 @@ U_NAMESPACE_USE
 static UnicodeSet *gInclusionSet = NULL;
 static UnicodeSet *gRecommendedSet = NULL;
 static const Normalizer2 *gNfdNormalizer = NULL;
-static UInitOnce gSpoofInitStaticsOnce = U_INITONCE_INITIALIZER;
+static UInitOnce gSpoofInitStaticsOnce {};
 
 namespace {
 
index f96826f86ccc1294ed8ae2ffea85b93615004f19..3e2386e09aa6746b1437b631485d7eb320e52a74 100644 (file)
@@ -538,7 +538,7 @@ spoofDataIsAcceptable(void *context,
 //  uspoof_cleanupDefaultData - Called during cleanup.
 //
 
-static UInitOnce gSpoofInitDefaultOnce = U_INITONCE_INITIALIZER;
+static UInitOnce gSpoofInitDefaultOnce {};
 static SpoofData* gDefaultSpoofData;
 
 static UBool U_CALLCONV
index e60215c9988e6dcf849f3d9fb8a7a3b0bf0cb92d..2522ebc3d05ee862ffee6bee6d64cf197c619e5d 100644 (file)
@@ -34,21 +34,21 @@ static icu::UMutex gZoneMetaLock;
 
 // CLDR Canonical ID mapping table
 static UHashtable *gCanonicalIDCache = NULL;
-static icu::UInitOnce gCanonicalIDCacheInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gCanonicalIDCacheInitOnce {};
 
 // Metazone mapping table
 static UHashtable *gOlsonToMeta = NULL;
-static icu::UInitOnce gOlsonToMetaInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gOlsonToMetaInitOnce {};
 
 // Available metazone IDs vector and table
 static icu::UVector *gMetaZoneIDs = NULL;
 static UHashtable *gMetaZoneIDTable = NULL;
-static icu::UInitOnce gMetaZoneIDsInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gMetaZoneIDsInitOnce {};
 
 // Country info vectors
 static icu::UVector *gSingleZoneCountries = NULL;
 static icu::UVector *gMultiZonesCountries = NULL;
-static icu::UInitOnce gCountryInfoVectorsInitOnce = U_INITONCE_INITIALIZER;
+static icu::UInitOnce gCountryInfoVectorsInitOnce {};
 
 U_CDECL_BEGIN
 
index 3c9effaadaffc0584fdb307695c33c8e74700b75..18dbc8f28cb9dd7bc25997c9e2673f3bd323a2bc 100644 (file)
@@ -41,7 +41,7 @@
 U_NAMESPACE_USE
 
 static UFILE *gStdOut = NULL;
-static UInitOnce gStdOutInitOnce = U_INITONCE_INITIALIZER;
+static UInitOnce gStdOutInitOnce {};
 
 static UBool U_CALLCONV uprintf_cleanup(void)
 {