[*] its always this one incompetent issue

This commit is contained in:
Reece Wilson 2022-09-08 23:30:49 +01:00
parent 7910db6d3d
commit ae1eb37ad9

View File

@ -111,13 +111,9 @@ 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 {};
#if !defined(ICU_DATA_DIR_WINDOWS)
static UDataFileAccess gDataFileAccess = UDATA_DEFAULT_ACCESS; // Access not synchronized.
// Modifying is documented as thread-unsafe.
#else
// If we are using the Windows data directory, then look in one spot only.
static UDataFileAccess gDataFileAccess = UDATA_NO_FILES;
#endif
static UBool U_CALLCONV
udata_cleanup(void)
@ -208,8 +204,6 @@ setCommonICUData(UDataMemory *pData, /* The new common data. Belongs to ca
return didUpdate;
}
#if !defined(ICU_DATA_DIR_WINDOWS)
static UBool
setCommonICUDataPointer(const void *pData, UBool /*warn*/, UErrorCode *pErrorCode) {
UDataMemory tData;
@ -219,8 +213,6 @@ setCommonICUDataPointer(const void *pData, UBool /*warn*/, UErrorCode *pErrorCod
return setCommonICUData(&tData, false, pErrorCode);
}
#endif
static const char *
findBasename(const char *path) {
const char *basename=uprv_strrchr(path, U_FILE_SEP_CHAR);
@ -641,10 +633,7 @@ U_NAMESPACE_END
* our common data. *
* *
*----------------------------------------------------------------------*/
#if !defined(ICU_DATA_DIR_WINDOWS)
// When using the Windows system data, we expect only a single data file.
extern "C" const DataHeader U_DATA_API U_ICUDATA_ENTRY_POINT;
#endif
/*
* This would be a good place for weak-linkage declarations of
@ -692,16 +681,7 @@ openCommonData(const char *path, /* Path from OpenChoice? */
if(gCommonICUDataArray[commonDataIndex] != NULL) {
return gCommonICUDataArray[commonDataIndex];
}
#if !defined(ICU_DATA_DIR_WINDOWS)
// When using the Windows system data, we expect only a single data file.
int32_t i;
for(i = 0; i < commonDataIndex; ++i) {
if(gCommonICUDataArray[i]->pHeader == &U_ICUDATA_ENTRY_POINT) {
/* The linked-in data is already in the list. */
return NULL;
}
}
#endif
}
/* Add the linked-in data to the list. */
@ -717,14 +697,7 @@ openCommonData(const char *path, /* Path from OpenChoice? */
setCommonICUDataPointer(uprv_getICUData_conversion(), false, pErrorCode);
}
*/
#if !defined(ICU_DATA_DIR_WINDOWS)
// When using the Windows system data, we expect only a single data file.
setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, false, pErrorCode);
{
Mutex lock;
return gCommonICUDataArray[commonDataIndex];
}
#endif
}