I 've below block of code with in a cpp file.
static const char* U_CALLCONV
ucnv_io_nextStandardAliases(UEnumeration *enumerator,
int32_t* resultLength,
UErrorCode * /*pErrorCode*/)
{
UAliasContext *myContext = (UAliasContext *)(enumerator->context);
uint32_t listOffset = myContext->listOffset;
if (listOffset) {
uint32_t listCount = gMainTable.taggedAliasLists[listOffset];
const uint16_t *currList = gMainTable.taggedAliasLists + listOffset + 1;
if (myContext->listIdx < listCount) {
const char *myStr = GET_STRING(currList[myContext->listIdx++]);
if (resultLength) {
*resultLength = (int32_t)uprv_strlen(myStr);
}
return myStr;
}
}
/* Either we accessed a zero length list, or we enumerated too far. */
if (resultLength) {
*resultLength = 0;
}
return NULL;
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
static const UEnumeration gEnumAliases = {
NULL,
NULL,
ucnv_io_closeUEnumeration,
ucnv_io_countStandardAliases,
uenum_unextDefault,
ucnv_io_nextStandardAliases, <== (Line 824)
ucnv_io_resetStandardAliases
};
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Where UEnumeration is declared as
struct UEnumeration {
void *baseContext;
void *context;
UEnumClose *close;
UEnumCount *count;
UEnumUNext *uNext;
UEnumNext *next; <==
UEnumReset *reset;
};
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
UEnumNext is declared as
typedef const char* U_CALLCONV
UEnumNext(UEnumeration* en,
int32_t* resultLength,
UErrorCode* status);
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ucnv_io_nextStandardAliases(UEnumeration *enumerator,
int32_t* resultLength,
UErrorCode * /*pErrorCode*/)
{
UAliasContext *myContext = (UAliasContext *)(enumerator->context);
uint32_t listOffset = myContext->listOffset;
if (listOffset) {
uint32_t listCount = gMainTable.taggedAliasLists[listOffset];
const uint16_t *currList = gMainTable.taggedAliasLists + listOffset + 1;
if (myContext->listIdx < listCount) {
const char *myStr = GET_STRING(currList[myContext->listIdx++]);
if (resultLength) {
*resultLength = (int32_t)uprv_strlen(myStr);
}
return myStr;
}
}
/* Either we accessed a zero length list, or we enumerated too far. */
if (resultLength) {
*resultLength = 0;
}
return NULL;
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
static const UEnumeration gEnumAliases = {
NULL,
NULL,
ucnv_io_closeUEnumeration,
ucnv_io_countStandardAliases,
uenum_unextDefault,
ucnv_io_nextStandardAliases, <== (Line 824)
ucnv_io_resetStandardAliases
};
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Where UEnumeration is declared as
struct UEnumeration {
void *baseContext;
void *context;
UEnumClose *close;
UEnumCount *count;
UEnumUNext *uNext;
UEnumNext *next; <==
UEnumReset *reset;
};
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
UEnumNext is declared as
typedef const char* U_CALLCONV
UEnumNext(UEnumeration* en,
int32_t* resultLength,
UErrorCode* status);
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
While compiling i am getting below errors on z/OS (USS) getting below error.
Compile command:
/bin/cxx -DU_ATTRIBUTE_DEPRECATED= -DOS390BATCH -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"icudata\" -DU_COMMON_IMPLEMENTATION -D_XOPEN_SOURCE=600 -DUCLN_NO_AUTO_CLEANUP=0 -DU_HAVE_ELF_H=1 -DU_HAVE_STD_STRING=0 -DU_HAVE_ATOMIC=0 -DU_DISABLE_RENAMING=1 -I/usr/local/ICU1510/src/source/common "-DDEFAULT_ICU_PLUGINS=\"/usr/local/ICU1510/os-390/build/lib/icu\" " -Wc,DLL,ROS,RTTI,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'LANGLVL(EXTENDED)' -+ -WI -c -D_SHR_TZNAME -D_SHR_TIMEZONE -Wc,expo -o ucnv_io.o /usr/local/ICU1510/src/source/common/ucnv_io.cpp
Error:
"/usr/local/ICU1510/src/source/common/ucnv_io.cpp", line 824.5: CCN5257 (S) An object or reference of type "UEnumNext *" cannot be initialized with an expression of type "char *(UEnumeration *, int32_t *, UErrorCode *)".
I could see there is no mismatch in the prototypes.
Not sure why it is not getting initialized. Same code works fine on Linux/Windows OS.
Any solution/workaround for this on z/OS?
Code'd