diff options
author | Tarek Mahmoud Sayed <tarekms@microsoft.com> | 2017-03-19 16:19:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-19 16:19:56 -0700 |
commit | d905f67f12c6b2eed918894e0642ec972a1d9fec (patch) | |
tree | 3cadd2047254b41ca45519361c86a53ae03023d2 /src/corefx | |
parent | 389b9abd4b109c68addca3bd215ab7626f84bb3d (diff) | |
download | coreclr-d905f67f12c6b2eed918894e0642ec972a1d9fec.tar.gz coreclr-d905f67f12c6b2eed918894e0642ec972a1d9fec.tar.bz2 coreclr-d905f67f12c6b2eed918894e0642ec972a1d9fec.zip |
Invariant globalization (#10264)
* Invariant Globalization Work
* Convert the testing Exceptions to asserts
* Remove un-needed comment
* Fix typos
* Fix unrelated typo
* Address the PR feedback
* More feedback addressing
* More feedback addressing
* Fix Linux break
* More feedback addressing
* cleanup
Diffstat (limited to 'src/corefx')
-rw-r--r-- | src/corefx/System.Globalization.Native/icushim.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/corefx/System.Globalization.Native/icushim.cpp b/src/corefx/System.Globalization.Native/icushim.cpp index 1c2187b488..f8f6dd317d 100644 --- a/src/corefx/System.Globalization.Native/icushim.cpp +++ b/src/corefx/System.Globalization.Native/icushim.cpp @@ -170,9 +170,11 @@ bool FindLibWithMajorMinorSubVersion(int* majorVer, int* minorVer, int* subVer) return false; } -// This function is ran at the end of dlopen for the current shared library -__attribute__((constructor)) -void InitializeICUShim() +// GlobalizationNative_LoadICU +// This method get called from the managed side during the globalization initialization. +// This method shouldn't get called at all if we are running in globalization invariant mode +// return 0 if failed to load ICU and 1 otherwise +extern "C" int32_t GlobalizationNative_LoadICU() { int majorVer = -1; int minorVer = -1; @@ -185,8 +187,7 @@ void InitializeICUShim() !FindLibWithMajorVersion(&majorVer)) { // No usable ICU version found - fprintf(stderr, "No usable version of the ICU libraries was found\n"); - abort(); + return 0; } char symbolName[128]; @@ -211,8 +212,7 @@ void InitializeICUShim() sprintf(symbolName, "u_strlen%s", symbolVersion); if (dlsym(libicuuc, symbolName) == nullptr) { - fprintf(stderr, "ICU libraries use unknown symbol versioning\n"); - abort(); + return 0; } } } @@ -227,6 +227,8 @@ void InitializeICUShim() FOR_ALL_ICU_FUNCTIONS #undef PER_FUNCTION_BLOCK + + return 1; } __attribute__((destructor)) |