From 6825277072a2dde351580d409fc905ce8ae787fd Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 27 Sep 2016 23:39:01 +0000 Subject: [PATCH] ICU-12752 commit some IBM z fixes. Library code building X-SVN-Rev: 39368 --- icu4c/source/common/loclikely.cpp | 3 +- icu4c/source/common/ucnv2022.cpp | 50 ++++++++++++------------- icu4c/source/common/ucnv_io.cpp | 12 +++--- icu4c/source/common/ucnv_io.h | 4 +- icu4c/source/common/ucnvbocu.cpp | 8 ++-- icu4c/source/common/ucnvmbcs.cpp | 47 ++++++++++++----------- icu4c/source/common/udata.cpp | 2 +- icu4c/source/common/uloc.cpp | 2 +- icu4c/source/common/umutex.h | 10 ++--- icu4c/source/common/unicode/platform.h | 6 +++ icu4c/source/common/uresbund.cpp | 4 +- icu4c/source/common/uresdata.cpp | 2 +- icu4c/source/i18n/collationroot.cpp | 2 +- icu4c/source/i18n/collationroot.h | 2 +- icu4c/source/i18n/dayperiodrules.cpp | 4 +- icu4c/source/i18n/dayperiodrules.h | 2 +- icu4c/source/i18n/dtfmtsym.cpp | 4 +- icu4c/source/i18n/dtptngen.cpp | 6 +-- icu4c/source/i18n/islamcal.cpp | 2 +- icu4c/source/i18n/islamcal.h | 2 +- icu4c/source/i18n/region.cpp | 2 +- icu4c/source/i18n/rulebasedcollator.cpp | 2 +- icu4c/source/i18n/tridpars.cpp | 2 +- icu4c/source/i18n/tridpars.h | 2 +- icu4c/source/i18n/ucln_in.cpp | 2 +- icu4c/source/i18n/ucol_imp.h | 2 +- icu4c/source/i18n/ucol_res.cpp | 2 +- icu4c/source/i18n/unicode/dtptngen.h | 2 +- icu4c/source/i18n/unicode/region.h | 2 +- icu4c/source/i18n/unicode/tblcoll.h | 2 +- icu4c/source/i18n/uspoof_impl.cpp | 2 +- icu4c/source/io/ucln_io.cpp | 2 +- 32 files changed, 102 insertions(+), 96 deletions(-) diff --git a/icu4c/source/common/loclikely.cpp b/icu4c/source/common/loclikely.cpp index 0a2afd4e052..c13b37e1a1f 100644 --- a/icu4c/source/common/loclikely.cpp +++ b/icu4c/source/common/loclikely.cpp @@ -1332,6 +1332,8 @@ Locale::isRightToLeft() const { return uloc_isRightToLeft(getBaseName()); } +U_NAMESPACE_END + // The following must at least allow for rg key value (6) plus terminator (1). #define ULOC_RG_BUFLEN 8 @@ -1381,4 +1383,3 @@ ulocimp_getRegionForSupplementalData(const char *localeID, UBool inferRegion, return u_terminateChars(region, regionCapacity, rgLen, status); } -U_NAMESPACE_END diff --git a/icu4c/source/common/ucnv2022.cpp b/icu4c/source/common/ucnv2022.cpp index 03fcbc5a05f..d4c3f5299c6 100644 --- a/icu4c/source/common/ucnv2022.cpp +++ b/icu4c/source/common/ucnv2022.cpp @@ -225,10 +225,10 @@ typedef struct{ /* ISO-2022 ----------------------------------------------------------------- */ /*Forward declaration */ -U_CFUNC void +U_CFUNC void U_CALLCONV ucnv_fromUnicode_UTF8(UConverterFromUnicodeArgs * args, UErrorCode * err); -U_CFUNC void +U_CFUNC void U_CALLCONV ucnv_fromUnicode_UTF8_OFFSETS_LOGIC(UConverterFromUnicodeArgs * args, UErrorCode * err); @@ -385,26 +385,26 @@ typedef enum{ } Variant2022; /*********** ISO 2022 Converter Protos ***********/ -static void +static void U_CALLCONV _ISO2022Open(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode); -static void +static void U_CALLCONV _ISO2022Close(UConverter *converter); -static void +static void U_CALLCONV _ISO2022Reset(UConverter *converter, UConverterResetChoice choice); -static const char* +static const char U_CALLCONV* _ISO2022getName(const UConverter* cnv); -static void +static void U_CALLCONV _ISO_2022_WriteSub(UConverterFromUnicodeArgs *args, int32_t offsetIndex, UErrorCode *err); -static UConverter * +static UConverter U_CALLCONV* _ISO_2022_SafeClone(const UConverter *cnv, void *stackBuffer, int32_t *pBufferSize, UErrorCode *status); #ifdef U_ENABLE_GENERIC_ISO_2022 -static void +static void U_CALLCONV T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverterToUnicodeArgs* args, UErrorCode* err); #endif @@ -470,7 +470,7 @@ setInitialStateFromUnicodeKR(UConverter* converter,UConverterDataISO2022 *myConv } } -static void +static void U_CALLCONV _ISO2022Open(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode){ char myLocale[6]={' ',' ',' ',' ',' ',' '}; @@ -648,7 +648,7 @@ _ISO2022Open(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorCode){ } -static void +static void U_CALLCONV _ISO2022Close(UConverter *converter) { UConverterDataISO2022* myData =(UConverterDataISO2022 *) (converter->extraInfo); UConverterSharedData **array = myData->myConverterArray; @@ -671,7 +671,7 @@ _ISO2022Close(UConverter *converter) { } } -static void +static void U_CALLCONV _ISO2022Reset(UConverter *converter, UConverterResetChoice choice) { UConverterDataISO2022 *myConverterData=(UConverterDataISO2022 *) (converter->extraInfo); if(choice<=UCNV_RESET_TO_UNICODE) { @@ -716,7 +716,7 @@ _ISO2022Reset(UConverter *converter, UConverterResetChoice choice) { } } -static const char* +static const char U_CALLCONV* _ISO2022getName(const UConverter* cnv){ if(cnv->extraInfo){ UConverterDataISO2022* myData= (UConverterDataISO2022*)cnv->extraInfo; @@ -1245,7 +1245,7 @@ _2022ToGR94DBCS(uint32_t value) { * */ -static void +static void U_CALLCONV T_UConverter_toUnicode_ISO_2022_OFFSETS_LOGIC(UConverterToUnicodeArgs* args, UErrorCode* err){ const char* mySourceLimit, *realSourceLimit; @@ -1651,7 +1651,7 @@ static const uint16_t hwkana_fb[HWKANA_END - HWKANA_START + 1] = { 0x212C /* U+FF9F */ }; -static void +static void U_CALLCONV UConverter_fromUnicode_ISO_2022_JP_OFFSETS_LOGIC(UConverterFromUnicodeArgs* args, UErrorCode* err) { UConverter *cnv = args->converter; UConverterDataISO2022 *converterData; @@ -2068,7 +2068,7 @@ getTrail: /*************** to unicode *******************/ -static void +static void U_CALLCONV UConverter_toUnicode_ISO_2022_JP_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCode* err){ char tempBuf[2]; @@ -2320,7 +2320,7 @@ endloop: * ii) There are only 2 shifting sequences SO to shift into double byte mode * and SI to shift into single byte mode */ -static void +static void U_CALLCONV UConverter_fromUnicode_ISO_2022_KR_OFFSETS_LOGIC_IBM(UConverterFromUnicodeArgs* args, UErrorCode* err){ UConverter* saveConv = args->converter; @@ -2344,7 +2344,7 @@ UConverter_fromUnicode_ISO_2022_KR_OFFSETS_LOGIC_IBM(UConverterFromUnicodeArgs* args->converter=saveConv; } -static void +static void U_CALLCONV UConverter_fromUnicode_ISO_2022_KR_OFFSETS_LOGIC(UConverterFromUnicodeArgs* args, UErrorCode* err){ const UChar *source = args->source; @@ -2563,7 +2563,7 @@ getTrail: /************************ To Unicode ***************************************/ -static void +static void U_CALLCONV UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGIC_IBM(UConverterToUnicodeArgs *args, UErrorCode* err){ char const* sourceStart; @@ -2661,7 +2661,7 @@ escape: } } -static void +static void U_CALLCONV UConverter_toUnicode_ISO_2022_KR_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCode* err){ char tempBuf[2]; @@ -2903,7 +2903,7 @@ static const char* const escSeqCharsCN[10] ={ CNS_11643_1992_Plane_7_STR }; -static void +static void U_CALLCONV UConverter_fromUnicode_ISO_2022_CN_OFFSETS_LOGIC(UConverterFromUnicodeArgs* args, UErrorCode* err){ UConverter *cnv = args->converter; UConverterDataISO2022 *converterData; @@ -3254,7 +3254,7 @@ getTrail: } -static void +static void U_CALLCONV UConverter_toUnicode_ISO_2022_CN_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCode* err){ char tempBuf[3]; @@ -3456,7 +3456,7 @@ endloop: } #endif /* #if !UCONFIG_ONLY_HTML_CONVERSION */ -static void +static void U_CALLCONV _ISO_2022_WriteSub(UConverterFromUnicodeArgs *args, int32_t offsetIndex, UErrorCode *err) { UConverter *cnv = args->converter; UConverterDataISO2022 *myConverterData=(UConverterDataISO2022 *) cnv->extraInfo; @@ -3580,7 +3580,7 @@ struct cloneStruct }; -static UConverter * +static UConverter U_CALLCONV * _ISO_2022_SafeClone( const UConverter *cnv, void *stackBuffer, @@ -3627,7 +3627,7 @@ _ISO_2022_SafeClone( return &localClone->cnv; } -static void +static void U_CALLCONV _ISO_2022_GetUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, diff --git a/icu4c/source/common/ucnv_io.cpp b/icu4c/source/common/ucnv_io.cpp index 9c3a5a87f20..9c94ab3c708 100644 --- a/icu4c/source/common/ucnv_io.cpp +++ b/icu4c/source/common/ucnv_io.cpp @@ -382,7 +382,7 @@ static const uint8_t ebcdicTypes[128] = { #endif /* @see ucnv_compareNames */ -U_CFUNC char * U_EXPORT2 +U_CAPI char * U_EXPORT2 ucnv_io_stripASCIIForCompare(char *dst, const char *name) { char *dstItr = dst; uint8_t type, nextType; @@ -417,7 +417,7 @@ ucnv_io_stripASCIIForCompare(char *dst, const char *name) { return dst; } -U_CFUNC char * U_EXPORT2 +U_CAPI char * U_EXPORT2 ucnv_io_stripEBCDICForCompare(char *dst, const char *name) { char *dstItr = dst; uint8_t type, nextType; @@ -778,7 +778,7 @@ ucnv_io_countStandardAliases(UEnumeration *enumerator, UErrorCode * /*pErrorCode return value; } -static const char* U_CALLCONV +static const char U_CALLCONV * ucnv_io_nextStandardAliases(UEnumeration *enumerator, int32_t* resultLength, UErrorCode * /*pErrorCode*/) @@ -1017,7 +1017,7 @@ ucnv_io_countAllConverters(UEnumeration * /*enumerator*/, UErrorCode * /*pErrorC return gMainTable.converterListSize; } -static const char* U_CALLCONV +static const char U_CALLCONV * ucnv_io_nextAllConverters(UEnumeration *enumerator, int32_t* resultLength, UErrorCode * /*pErrorCode*/) @@ -1087,7 +1087,7 @@ ucnv_io_countKnownConverters(UErrorCode *pErrorCode) { /* alias table swapping ----------------------------------------------------- */ -typedef char * U_CALLCONV StripForCompareFn(char *dst, const char *name); +typedef char U_CALLCONV * StripForCompareFn(char *dst, const char *name); /* * row of a temporary array @@ -1111,7 +1111,7 @@ enum { STACK_ROW_CAPACITY=500 }; -static int32_t +static int32_t U_CALLCONV io_compareRows(const void *context, const void *left, const void *right) { char strippedLeft[UCNV_MAX_CONVERTER_NAME_LENGTH], strippedRight[UCNV_MAX_CONVERTER_NAME_LENGTH]; diff --git a/icu4c/source/common/ucnv_io.h b/icu4c/source/common/ucnv_io.h index d0b52cebf66..bfaca1794c1 100644 --- a/icu4c/source/common/ucnv_io.h +++ b/icu4c/source/common/ucnv_io.h @@ -77,10 +77,10 @@ typedef struct UConverterAlias { # error U_CHARSET_FAMILY is not valid #endif -U_CAPI char * U_EXPORT2 +U_CAPI char U_CALLCONV * ucnv_io_stripASCIIForCompare(char *dst, const char *name); -U_CAPI char * U_EXPORT2 +U_CAPI char U_CALLCONV * ucnv_io_stripEBCDICForCompare(char *dst, const char *name); /** diff --git a/icu4c/source/common/ucnvbocu.cpp b/icu4c/source/common/ucnvbocu.cpp index 50c3dc395e8..69763ca3213 100644 --- a/icu4c/source/common/ucnvbocu.cpp +++ b/icu4c/source/common/ucnvbocu.cpp @@ -388,7 +388,7 @@ packDiff(int32_t diff) { } -static void +static void U_CALLCONV _Bocu1FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -649,7 +649,7 @@ getTrail: * re-copy the original function and remove the variables * offsets, sourceIndex, and nextSourceIndex. */ -static void +static void U_CALLCONV _Bocu1FromUnicode(UConverterFromUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -952,7 +952,7 @@ decodeBocu1TrailByte(int32_t count, int32_t b) { } } -static void +static void U_CALLCONV _Bocu1ToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -1175,7 +1175,7 @@ endloop: * re-copy the original function and remove the variables * offsets, sourceIndex, and nextSourceIndex. */ -static void +static void U_CALLCONV _Bocu1ToUnicode(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; diff --git a/icu4c/source/common/ucnvmbcs.cpp b/icu4c/source/common/ucnvmbcs.cpp index af813a2b9e4..c5ea059cbed 100644 --- a/icu4c/source/common/ucnvmbcs.cpp +++ b/icu4c/source/common/ucnvmbcs.cpp @@ -377,53 +377,53 @@ typedef UBool U_CALLCONV UConverterEnumToUCallback(const void *context, uint32_t value, UChar32 codePoints[32]); -static void +static void U_CALLCONV ucnv_MBCSLoad(UConverterSharedData *sharedData, UConverterLoadArgs *pArgs, const uint8_t *raw, UErrorCode *pErrorCode); -static void +static void U_CALLCONV ucnv_MBCSUnload(UConverterSharedData *sharedData); -static void +static void U_CALLCONV ucnv_MBCSOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *pErrorCode); -static UChar32 +static UChar32 U_CALLCONV ucnv_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode); -static void +static void U_CALLCONV ucnv_MBCSGetStarters(const UConverter* cnv, UBool starters[256], UErrorCode *pErrorCode); -static const char * +static const char U_CALLCONV * ucnv_MBCSGetName(const UConverter *cnv); -static void +static void U_CALLCONV ucnv_MBCSWriteSub(UConverterFromUnicodeArgs *pArgs, int32_t offsetIndex, UErrorCode *pErrorCode); -static UChar32 +static UChar32 U_CALLCONV ucnv_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode); -static void +static void U_CALLCONV ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, UConverterToUnicodeArgs *pToUArgs, UErrorCode *pErrorCode); -static void +static void U_CALLCONV ucnv_MBCSGetUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, UErrorCode *pErrorCode); -static void +static void U_CALLCONV ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, UConverterToUnicodeArgs *pToUArgs, UErrorCode *pErrorCode); @@ -505,7 +505,6 @@ static const UConverterImpl _MBCSImpl={ NULL }; - /* Static data is in tools/makeconv/ucnvstat.c for data-based * converters. Be sure to update it as well. */ @@ -847,7 +846,7 @@ ucnv_MBCSEnumToUnicode(UConverterMBCSTable *mbcsTable, } } -U_CFUNC void +U_CFUNC void ucnv_MBCSGetFilteredUnicodeSetForUnicode(const UConverterSharedData *sharedData, const USetAdder *sa, UConverterUnicodeSet which, @@ -1069,7 +1068,7 @@ ucnv_MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData, pErrorCode); } -static void +static void U_CALLCONV ucnv_MBCSGetUnicodeSet(const UConverter *cnv, const USetAdder *sa, UConverterUnicodeSet which, @@ -1549,7 +1548,7 @@ reconstituteData(UConverterMBCSTable *mbcsTable, /* MBCS setup functions ----------------------------------------------------- */ -static void +static void U_CALLCONV ucnv_MBCSLoad(UConverterSharedData *sharedData, UConverterLoadArgs *pArgs, const uint8_t *raw, @@ -1874,7 +1873,7 @@ ucnv_MBCSLoad(UConverterSharedData *sharedData, } } -static void +static void U_CALLCONV ucnv_MBCSUnload(UConverterSharedData *sharedData) { UConverterMBCSTable *mbcsTable=&sharedData->mbcs; @@ -1892,7 +1891,7 @@ ucnv_MBCSUnload(UConverterSharedData *sharedData) { } } -static void +static void U_CALLCONV ucnv_MBCSOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *pErrorCode) { @@ -1983,7 +1982,7 @@ ucnv_MBCSOpen(UConverter *cnv, #endif } -static const char * +static const char U_CALLCONV * ucnv_MBCSGetName(const UConverter *cnv) { if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0 && cnv->sharedData->mbcs.swapLFNLName!=NULL) { return cnv->sharedData->mbcs.swapLFNLName; @@ -1994,7 +1993,7 @@ ucnv_MBCSGetName(const UConverter *cnv) { /* MBCS-to-Unicode conversion functions ------------------------------------- */ -static UChar32 +static UChar32 U_CALLCONV ucnv_MBCSGetFallback(UConverterMBCSTable *mbcsTable, uint32_t offset) { const _MBCSToUFallback *toUFallbacks; uint32_t i, start, limit; @@ -2957,7 +2956,7 @@ ucnv_MBCSSingleGetNextUChar(UConverterToUnicodeArgs *pArgs, * * All normal mappings and errors are handled here. */ -static UChar32 +static UChar32 U_CALLCONV ucnv_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs, UErrorCode *pErrorCode) { UConverter *cnv; @@ -5014,7 +5013,7 @@ utf8_minLegal[5]={ 0, 0, 0x80, 0x800, 0x10000 }; static const UChar32 utf8_offsets[7]={ 0, 0, 0x3080, 0xE2080, 0x3C82080 }; -static void +static void U_CALLCONV ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, UConverterToUnicodeArgs *pToUArgs, UErrorCode *pErrorCode) { @@ -5320,7 +5319,7 @@ moreBytes: pFromUArgs->target=(char *)target; } -static void +static void U_CALLCONV ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, UConverterToUnicodeArgs *pToUArgs, UErrorCode *pErrorCode) { @@ -5632,7 +5631,7 @@ unassigned: /* miscellaneous ------------------------------------------------------------ */ -static void +static void U_CALLCONV ucnv_MBCSGetStarters(const UConverter* cnv, UBool starters[256], UErrorCode *) { @@ -5655,7 +5654,7 @@ ucnv_MBCSIsLeadByte(UConverterSharedData *sharedData, char byte) { return (UBool)MBCS_ENTRY_IS_TRANSITION(sharedData->mbcs.stateTable[0][(uint8_t)byte]); } -static void +static void U_CALLCONV ucnv_MBCSWriteSub(UConverterFromUnicodeArgs *pArgs, int32_t offsetIndex, UErrorCode *pErrorCode) { diff --git a/icu4c/source/common/udata.cpp b/icu4c/source/common/udata.cpp index cfcf1f3fe2a..ec72a0ce2c7 100644 --- a/icu4c/source/common/udata.cpp +++ b/icu4c/source/common/udata.cpp @@ -270,7 +270,7 @@ static void U_CALLCONV DataCacheElement_deleter(void *pDCEl) { uprv_free(pDCEl); /* delete 'this' */ } -static void udata_initHashTable(UErrorCode &err) { +static void U_CALLCONV udata_initHashTable(UErrorCode &err) { U_ASSERT(gCommonDataCache == NULL); gCommonDataCache = uhash_open(uhash_hashChars, uhash_compareChars, NULL, &err); if (U_FAILURE(err)) { diff --git a/icu4c/source/common/uloc.cpp b/icu4c/source/common/uloc.cpp index 3b07f6eab0c..da254a59566 100644 --- a/icu4c/source/common/uloc.cpp +++ b/icu4c/source/common/uloc.cpp @@ -1492,7 +1492,7 @@ uloc_kw_countKeywords(UEnumeration *en, UErrorCode * /*status*/) { return result; } -static const char* U_CALLCONV +static const char U_CALLCONV* uloc_kw_nextKeyword(UEnumeration* en, int32_t* resultLength, UErrorCode* /*status*/) { diff --git a/icu4c/source/common/umutex.h b/icu4c/source/common/umutex.h index d0d35d585aa..f1fc4bb5d9b 100644 --- a/icu4c/source/common/umutex.h +++ b/icu4c/source/common/umutex.h @@ -231,7 +231,7 @@ struct UInitOnce { U_COMMON_API UBool U_EXPORT2 umtx_initImplPreInit(UInitOnce &); U_COMMON_API void U_EXPORT2 umtx_initImplPostInit(UInitOnce &); -template void umtx_initOnce(UInitOnce &uio, T *obj, void (T::*fp)()) { +template void umtx_initOnce(UInitOnce &uio, T *obj, void (T::*U_CALLCONV fp)()) { if (umtx_loadAcquire(uio.fState) == 2) { return; } @@ -244,7 +244,7 @@ template void umtx_initOnce(UInitOnce &uio, T *obj, void (T::*fp)()) { // umtx_initOnce variant for plain functions, or static class functions. // No context parameter. -inline void umtx_initOnce(UInitOnce &uio, void (*fp)()) { +inline void umtx_initOnce(UInitOnce &uio, void (*U_CALLCONV fp)()) { if (umtx_loadAcquire(uio.fState) == 2) { return; } @@ -256,7 +256,7 @@ inline void umtx_initOnce(UInitOnce &uio, void (*fp)()) { // umtx_initOnce variant for plain functions, or static class functions. // With ErrorCode, No context parameter. -inline void umtx_initOnce(UInitOnce &uio, void (*fp)(UErrorCode &), UErrorCode &errCode) { +inline void umtx_initOnce(UInitOnce &uio, void (*U_CALLCONV fp)(UErrorCode &), UErrorCode &errCode) { if (U_FAILURE(errCode)) { return; } @@ -275,7 +275,7 @@ inline void umtx_initOnce(UInitOnce &uio, void (*fp)(UErrorCode &), UErrorCode & // umtx_initOnce variant for plain functions, or static class functions, // with a context parameter. -template void umtx_initOnce(UInitOnce &uio, void (*fp)(T), T context) { +template void umtx_initOnce(UInitOnce &uio, void (*U_CALLCONV fp)(T), T context) { if (umtx_loadAcquire(uio.fState) == 2) { return; } @@ -287,7 +287,7 @@ template void umtx_initOnce(UInitOnce &uio, void (*fp)(T), T context) { // umtx_initOnce variant for plain functions, or static class functions, // with a context parameter and an error code. -template void umtx_initOnce(UInitOnce &uio, void (*fp)(T, UErrorCode &), T context, UErrorCode &errCode) { +template void umtx_initOnce(UInitOnce &uio, void (*U_CALLCONV fp)(T, UErrorCode &), T context, UErrorCode &errCode) { if (U_FAILURE(errCode)) { return; } diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index 92a94c47eee..157c951d046 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -843,6 +843,12 @@ * This is only used for non-ICU-API functions. * When a function is a public ICU API, * you must use the U_CAPI and U_EXPORT2 qualifiers. + * + * Please note, you need to use U_CALLCONV before the *. + * + * YES: "static const char U_CALLCONV *func( . . . )" + * NO: "static const char* U_CALLCONV func( . . . )" + * * @stable ICU 2.0 */ #if U_PLATFORM == U_PF_OS390 && defined(__cplusplus) diff --git a/icu4c/source/common/uresbund.cpp b/icu4c/source/common/uresbund.cpp index c49e1e54868..2e524eb07dd 100644 --- a/icu4c/source/common/uresbund.cpp +++ b/icu4c/source/common/uresbund.cpp @@ -269,7 +269,7 @@ static UBool U_CALLCONV ures_cleanup(void) } /** INTERNAL: Initializes the cache for resources */ -static void createCache(UErrorCode &status) { +static void U_CALLCONV createCache(UErrorCode &status) { U_ASSERT(cache == NULL); cache = uhash_open(hashEntry, compareEntries, NULL, &status); ucln_common_registerCleanup(UCLN_COMMON_URES, ures_cleanup); @@ -2408,7 +2408,7 @@ ures_loc_countLocales(UEnumeration *en, UErrorCode * /*status*/) { return ures_getSize(&ctx->installed); } -static const char* U_CALLCONV +static const char U_CALLCONV * ures_loc_nextLocale(UEnumeration* en, int32_t* resultLength, UErrorCode* status) { diff --git a/icu4c/source/common/uresdata.cpp b/icu4c/source/common/uresdata.cpp index 9a1ed11d60f..44654dcf579 100644 --- a/icu4c/source/common/uresdata.cpp +++ b/icu4c/source/common/uresdata.cpp @@ -985,7 +985,7 @@ typedef struct Row { int32_t keyIndex, sortIndex; } Row; -static int32_t +static int32_t U_CALLCONV ures_compareRows(const void *context, const void *left, const void *right) { const char *keyChars=(const char *)context; return (int32_t)uprv_strcmp(keyChars+((const Row *)left)->keyIndex, diff --git a/icu4c/source/i18n/collationroot.cpp b/icu4c/source/i18n/collationroot.cpp index 354b426d256..f862e410b81 100644 --- a/icu4c/source/i18n/collationroot.cpp +++ b/icu4c/source/i18n/collationroot.cpp @@ -47,7 +47,7 @@ static UBool U_CALLCONV uprv_collation_root_cleanup() { U_CDECL_END -void +void U_CALLCONV CollationRoot::load(UErrorCode &errorCode) { if(U_FAILURE(errorCode)) { return; } LocalPointer t(new CollationTailoring(NULL)); diff --git a/icu4c/source/i18n/collationroot.h b/icu4c/source/i18n/collationroot.h index 96fb574412a..26e5071fff8 100644 --- a/icu4c/source/i18n/collationroot.h +++ b/icu4c/source/i18n/collationroot.h @@ -36,7 +36,7 @@ public: static const CollationSettings *getSettings(UErrorCode &errorCode); private: - static void load(UErrorCode &errorCode); + static void U_CALLCONV load(UErrorCode &errorCode); }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/dayperiodrules.cpp b/icu4c/source/i18n/dayperiodrules.cpp index 5ebaed3ce8b..30414823efd 100644 --- a/icu4c/source/i18n/dayperiodrules.cpp +++ b/icu4c/source/i18n/dayperiodrules.cpp @@ -303,7 +303,7 @@ namespace { UInitOnce initOnce = U_INITONCE_INITIALIZER; -UBool dayPeriodRulesCleanup() { +U_CFUNC UBool U_CALLCONV dayPeriodRulesCleanup() { delete[] data->rules; uhash_close(data->localeToRuleSetNumMap); delete data; @@ -313,7 +313,7 @@ UBool dayPeriodRulesCleanup() { } // namespace -void DayPeriodRules::load(UErrorCode &errorCode) { +void U_CALLCONV DayPeriodRules::load(UErrorCode &errorCode) { if (U_FAILURE(errorCode)) { return; } diff --git a/icu4c/source/i18n/dayperiodrules.h b/icu4c/source/i18n/dayperiodrules.h index 7345f76f99b..3c006cdc2f5 100644 --- a/icu4c/source/i18n/dayperiodrules.h +++ b/icu4c/source/i18n/dayperiodrules.h @@ -61,7 +61,7 @@ private: // Translates "morning1" to DAYPERIOD_MORNING1, for example. static DayPeriod getDayPeriodFromString(const char *type_str); - static void load(UErrorCode &errorCode); + static void U_CALLCONV load(UErrorCode &errorCode); // Sets period type for all hours in [startHour, limitHour). void add(int32_t startHour, int32_t limitHour, DayPeriod period); diff --git a/icu4c/source/i18n/dtfmtsym.cpp b/icu4c/source/i18n/dtfmtsym.cpp index d7f869e14b1..c6e4b640025 100644 --- a/icu4c/source/i18n/dtfmtsym.cpp +++ b/icu4c/source/i18n/dtfmtsym.cpp @@ -1832,12 +1832,12 @@ struct CalendarDataSink : public ResourceSink { } // Deleter function to be used by 'arrays' - static void deleteUnicodeStringArray(void *uArray) { + static void U_CALLCONV deleteUnicodeStringArray(void *uArray) { delete[] static_cast(uArray); } // Deleter function to be used by 'maps' - static void deleteHashtable(void *table) { + static void U_CALLCONV deleteHashtable(void *table) { delete static_cast(table); } }; diff --git a/icu4c/source/i18n/dtptngen.cpp b/icu4c/source/i18n/dtptngen.cpp index f57f08fe1f5..17e7ec7cde8 100644 --- a/icu4c/source/i18n/dtptngen.cpp +++ b/icu4c/source/i18n/dtptngen.cpp @@ -390,12 +390,12 @@ UInitOnce initOnce = U_INITONCE_INITIALIZER; UHashtable *localeToAllowedHourFormatsMap = NULL; // Value deleter for hashmap. -void deleteAllowedHourFormats(void *ptr) { +U_CFUNC void U_CALLCONV deleteAllowedHourFormats(void *ptr) { uprv_free(ptr); } // Close hashmap at cleanup. -UBool allowedHourFormatsCleanup() { +U_CFUNC UBool U_CALLCONV allowedHourFormatsCleanup() { uhash_close(localeToAllowedHourFormatsMap); return TRUE; } @@ -494,7 +494,7 @@ struct AllowedHourFormatsSink : public ResourceSink { AllowedHourFormatsSink::~AllowedHourFormatsSink() {} -void DateTimePatternGenerator::loadAllowedHourFormatsData(UErrorCode &status) { +U_CFUNC void U_CALLCONV DateTimePatternGenerator::loadAllowedHourFormatsData(UErrorCode &status) { if (U_FAILURE(status)) { return; } localeToAllowedHourFormatsMap = uhash_open( uhash_hashChars, uhash_compareChars, NULL, &status); diff --git a/icu4c/source/i18n/islamcal.cpp b/icu4c/source/i18n/islamcal.cpp index aaccca9ec6c..123b245f2d9 100644 --- a/icu4c/source/i18n/islamcal.cpp +++ b/icu4c/source/i18n/islamcal.cpp @@ -736,7 +736,7 @@ int32_t IslamicCalendar::defaultCenturyStartYear() const } -void U_CALLCONV +U_CFUNC void U_CALLCONV IslamicCalendar::initializeSystemDefaultCentury() { // initialize systemDefaultCentury and systemDefaultCenturyYear based diff --git a/icu4c/source/i18n/islamcal.h b/icu4c/source/i18n/islamcal.h index 16e26c9c1b9..7f6faed8867 100644 --- a/icu4c/source/i18n/islamcal.h +++ b/icu4c/source/i18n/islamcal.h @@ -419,7 +419,7 @@ class U_I18N_API IslamicCalendar : public Calendar { * are considered to fall within so that its start date is 80 years * before the current time. */ - static void initializeSystemDefaultCentury(void); + static void U_CALLCONV initializeSystemDefaultCentury(void); }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/region.cpp b/icu4c/source/i18n/region.cpp index 22d767e9cc9..81ddc233384 100644 --- a/icu4c/source/i18n/region.cpp +++ b/icu4c/source/i18n/region.cpp @@ -81,7 +81,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RegionNameEnumeration) * If the region data has already loaded, then this method simply returns without doing * anything meaningful. */ -void Region::loadRegionData(UErrorCode &status) { +void U_CALLCONV Region::loadRegionData(UErrorCode &status) { // Construct service objs first LocalUHashtablePointer newRegionIDMap(uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, NULL, &status)); diff --git a/icu4c/source/i18n/rulebasedcollator.cpp b/icu4c/source/i18n/rulebasedcollator.cpp index dd70d457c69..4852667ada8 100644 --- a/icu4c/source/i18n/rulebasedcollator.cpp +++ b/icu4c/source/i18n/rulebasedcollator.cpp @@ -1611,7 +1611,7 @@ RuleBasedCollator::isUnsafe(UChar32 c) const { return data->isUnsafeBackward(c, settings->isNumeric()); } -void +void U_CALLCONV RuleBasedCollator::computeMaxExpansions(const CollationTailoring *t, UErrorCode &errorCode) { t->maxExpansions = CollationElementIterator::computeMaxExpansions(t->data, errorCode); } diff --git a/icu4c/source/i18n/tridpars.cpp b/icu4c/source/i18n/tridpars.cpp index 947f642d7a9..f5d2799f9f1 100644 --- a/icu4c/source/i18n/tridpars.cpp +++ b/icu4c/source/i18n/tridpars.cpp @@ -904,7 +904,7 @@ Transliterator* TransliteratorIDParser::createBasicInstance(const UnicodeString& /** * Initialize static memory. Called through umtx_initOnce only. */ -void TransliteratorIDParser::init(UErrorCode &status) { +void U_CALLCONV TransliteratorIDParser::init(UErrorCode &status) { U_ASSERT(SPECIAL_INVERSES == NULL); ucln_i18n_registerCleanup(UCLN_I18N_TRANSLITERATOR, utrans_transliterator_cleanup); diff --git a/icu4c/source/i18n/tridpars.h b/icu4c/source/i18n/tridpars.h index a64aabe62f6..63cfdff61e7 100644 --- a/icu4c/source/i18n/tridpars.h +++ b/icu4c/source/i18n/tridpars.h @@ -351,7 +351,7 @@ class TransliteratorIDParser /* not : public UObject because all methods are sta /** * Initialize static memory. */ - static void init(UErrorCode &status); + static void U_CALLCONV init(UErrorCode &status); friend class SingleID; }; diff --git a/icu4c/source/i18n/ucln_in.cpp b/icu4c/source/i18n/ucln_in.cpp index a15ae025502..8139208cba7 100644 --- a/icu4c/source/i18n/ucln_in.cpp +++ b/icu4c/source/i18n/ucln_in.cpp @@ -30,7 +30,7 @@ static const char copyright[] = U_COPYRIGHT_STRING; static cleanupFunc *gCleanupFunctions[UCLN_I18N_COUNT]; -static UBool i18n_cleanup(void) +static UBool U_CALLCONV i18n_cleanup(void) { int32_t libType = UCLN_I18N_START; (void)copyright; /* Suppress unused variable warning with clang. */ diff --git a/icu4c/source/i18n/ucol_imp.h b/icu4c/source/i18n/ucol_imp.h index e72eb9dff2f..7c9e8f68911 100644 --- a/icu4c/source/i18n/ucol_imp.h +++ b/icu4c/source/i18n/ucol_imp.h @@ -78,7 +78,7 @@ public: const CollationCacheEntry *createCacheEntry(UErrorCode &errorCode); private: - static void loadRootRules(UErrorCode &errorCode); + static void U_CALLCONV loadRootRules(UErrorCode &errorCode); // The following members are used by loadTailoring() // and the cache callback. diff --git a/icu4c/source/i18n/ucol_res.cpp b/icu4c/source/i18n/ucol_res.cpp index 4a2a0d909db..b3774fd6417 100644 --- a/icu4c/source/i18n/ucol_res.cpp +++ b/icu4c/source/i18n/ucol_res.cpp @@ -80,7 +80,7 @@ ucol_res_cleanup() { U_CDECL_END -void +U_CAPI void U_CALLCONV CollationLoader::loadRootRules(UErrorCode &errorCode) { if(U_FAILURE(errorCode)) { return; } rootBundle = ures_open(U_ICUDATA_COLL, kRootLocaleName, &errorCode); diff --git a/icu4c/source/i18n/unicode/dtptngen.h b/icu4c/source/i18n/unicode/dtptngen.h index 7bf513f6624..fd617ce3cdc 100644 --- a/icu4c/source/i18n/unicode/dtptngen.h +++ b/icu4c/source/i18n/unicode/dtptngen.h @@ -554,7 +554,7 @@ private: UBool isAvailableFormatSet(const UnicodeString &key) const; void copyHashtable(Hashtable *other, UErrorCode &status); UBool isCanonicalItem(const UnicodeString& item) const; - static void loadAllowedHourFormatsData(UErrorCode &status); + static void U_CALLCONV loadAllowedHourFormatsData(UErrorCode &status); void getAllowedHourFormats(const Locale &locale, UErrorCode &status); struct AppendItemFormatsSink; diff --git a/icu4c/source/i18n/unicode/region.h b/icu4c/source/i18n/unicode/region.h index 94610aae1b2..6bb6c746b10 100644 --- a/icu4c/source/i18n/unicode/region.h +++ b/icu4c/source/i18n/unicode/region.h @@ -212,7 +212,7 @@ private: * anything meaningful. */ - static void loadRegionData(UErrorCode &status); + static void U_CALLCONV loadRegionData(UErrorCode &status); }; diff --git a/icu4c/source/i18n/unicode/tblcoll.h b/icu4c/source/i18n/unicode/tblcoll.h index c5a3939e22b..c48ea38c130 100644 --- a/icu4c/source/i18n/unicode/tblcoll.h +++ b/icu4c/source/i18n/unicode/tblcoll.h @@ -856,7 +856,7 @@ private: */ UBool isUnsafe(UChar32 c) const; - static void computeMaxExpansions(const CollationTailoring *t, UErrorCode &errorCode); + static void U_CALLCONV computeMaxExpansions(const CollationTailoring *t, UErrorCode &errorCode); UBool initMaxExpansions(UErrorCode &errorCode) const; void setFastLatinOptions(CollationSettings &ownedSettings) const; diff --git a/icu4c/source/i18n/uspoof_impl.cpp b/icu4c/source/i18n/uspoof_impl.cpp index a7ce8ee2601..a062d3ee24b 100644 --- a/icu4c/source/i18n/uspoof_impl.cpp +++ b/icu4c/source/i18n/uspoof_impl.cpp @@ -538,7 +538,7 @@ uspoof_cleanupDefaultData(void) { return TRUE; } -static void uspoof_loadDefaultData(UErrorCode& status) { +static void U_CALLCONV uspoof_loadDefaultData(UErrorCode& status) { UDataMemory *udm = udata_openChoice(NULL, "cfu", "confusables", spoofDataIsAcceptable, NULL, // context, would receive dataVersion if supplied. diff --git a/icu4c/source/io/ucln_io.cpp b/icu4c/source/io/ucln_io.cpp index bb71c8b05d1..21a0baf58db 100644 --- a/icu4c/source/io/ucln_io.cpp +++ b/icu4c/source/io/ucln_io.cpp @@ -35,7 +35,7 @@ static const char copyright[] = U_COPYRIGHT_STRING; static cleanupFunc *gCleanupFunctions[UCLN_IO_COUNT]; -static UBool io_cleanup(void) +static UBool U_CALLCONV io_cleanup(void) { int32_t libType = UCLN_IO_START;