Skip to content

Commit

Permalink
Select libraries using the ICU build time version (dotnet#79259)
Browse files Browse the repository at this point in the history
  • Loading branch information
wscho77 authored Dec 11, 2022
1 parent 3689fbe commit cfdf0f6
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/native/libs/System.Globalization.Native/pal_icushim.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,18 +294,28 @@ static int FindLibUsingOverride(const char* versionPrefix, char* symbolName, cha
char* versionOverride = getenv("CLR_ICU_VERSION_OVERRIDE");
if (versionOverride != NULL)
{
int first = -1;
int second = -1;
int third = -1;

int matches = sscanf(versionOverride, "%d.%d.%d", &first, &second, &third);
if (matches > 0)
if (strcmp(versionOverride, "build") == 0)
{
if (OpenICULibraries(first, second, third, versionPrefix, symbolName, symbolVersion))
if (OpenICULibraries(U_ICU_VERSION_MAJOR_NUM, -1, -1, versionPrefix, symbolName, symbolVersion))
{
return true;
}
}
else
{
int first = -1;
int second = -1;
int third = -1;

int matches = sscanf(versionOverride, "%d.%d.%d", &first, &second, &third);
if (matches > 0)
{
if (OpenICULibraries(first, second, third, versionPrefix, symbolName, symbolVersion))
{
return true;
}
}
}
}

return false;
Expand Down

0 comments on commit cfdf0f6

Please sign in to comment.