From a7b756179a7ea61ed1c0cb2c2438b72ce40d9350 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Thu, 15 Feb 2024 15:33:03 +0100 Subject: [PATCH 01/17] Move out globalization code from runtime --- src/mono/CMakeLists.txt | 73 ------------------------- src/mono/mono.proj | 25 --------- src/mono/mono/metadata/native-library.c | 30 ---------- src/mono/mono/mini/CMakeLists.txt | 72 ------------------------ 4 files changed, 200 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 00f883aca07e4b..e7db5576d3e5cf 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -710,79 +710,6 @@ if(LLVM_PREFIX) add_definitions(-DLLVM_API_VERSION=${llvm_api_version}) endif() -###################################### -# ICU CHECKS -###################################### -if(HOST_OSX OR HOST_MACCAT OR HOST_IOS OR HOST_TVOS) - # FIXME: Handle errors - execute_process(COMMAND brew --prefix OUTPUT_VARIABLE brew_prefix OUTPUT_STRIP_TRAILING_WHITESPACE) - - if((HOST_MACCAT OR HOST_IOS OR HOST_TVOS) AND "${CMAKE_SHARED_LINKER_FLAGS}" MATCHES "${brew_prefix}/opt/icu4c/lib") - message(FATAL_ERROR "Linker flags contain the Homebrew version of ICU which conflicts with the iOS/tvOS/MacCatalyst version: ${CMAKE_SHARED_LINKER_FLAGS}") - endif() -endif() - -set(ICU_SHIM_PATH "${CLR_SRC_NATIVE_DIR}/libs/System.Globalization.Native") -if(MONO_CROSS_COMPILE) -elseif(HOST_OSX AND NOT HOST_MACCAT) - include(FindPkgConfig) - set(ENV{PKG_CONFIG_PATH} "{$PKG_CONFIG_PATH}:${brew_prefix}/lib/pkgconfig:${brew_prefix}/opt/icu4c/lib/pkgconfig") - # Defines ICU_INCLUDEDIR/ICU_LIBDIR - pkg_check_modules(ICU icu-uc) - set(OSX_ICU_LIBRARY_PATH /usr/lib/libicucore.dylib) - set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations") - set(HAVE_SYS_ICU 1) -elseif(HOST_WASI) - set(ICU_FLAGS "-DPALEXPORT=\"\" -DU_DISABLE_RENAMING -DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS -DHAVE_SET_MAX_VARIABLE -DTARGET_UNIX -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option") - set(HAVE_SYS_ICU 1) - set(STATIC_ICU 1) - set(ICU_LIBS "icucore") -elseif(HOST_BROWSER) - set(ICU_FLAGS "-DPALEXPORT=\"\" -DU_DISABLE_RENAMING -DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS -DHAVE_SET_MAX_VARIABLE -DTARGET_UNIX -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option") - set(HAVE_SYS_ICU 1) - set(STATIC_ICU 1) - set(ICU_LIBS "icucore") -elseif(HOST_IOS OR HOST_TVOS OR HOST_MACCAT) - set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations") - if(HOST_IOS) - string(APPEND ICU_FLAGS " -DTARGET_IOS") - elseif(HOST_TVOS) - string(APPEND ICU_FLAGS " -DTARGET_TVOS") - elseif(HOST_MACCAT) - string(APPEND ICU_FLAGS " -DTARGET_MACCATALYST") - endif() - string(APPEND ICU_FLAGS " -DAPPLE_HYBRID_GLOBALIZATION") - set(HAVE_SYS_ICU 1) - set(STATIC_ICU 1) -elseif(HOST_ANDROID) - set(ICU_FLAGS "-DPALEXPORT=\"\" -DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS -DHAVE_SET_MAX_VARIABLE -DTARGET_UNIX -DTARGET_ANDROID -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option") - set(HAVE_SYS_ICU 1) -elseif(HOST_LINUX) - include(FindPkgConfig) - if(CROSS_ROOTFS) - set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CROSS_ROOTFS}") - endif(CROSS_ROOTFS) - pkg_check_modules(ICU icu-uc) - set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations") - set(HAVE_SYS_ICU 1) -elseif(HOST_WIN32) - set(ICU_FLAGS "-DTARGET_WINDOWS -DPALEXPORT=EXTERN_C") - set(HAVE_SYS_ICU 1) -elseif(HOST_SOLARIS) - set(ICU_FLAGS "-DPALEXPORT=\"\" -DTARGET_UNIX -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option") - set(HAVE_SYS_ICU 1) -elseif(TARGET_FREEBSD) - set(ICU_FLAGS "-DTARGET_UNIX -Wno-deprecated-declarations") - set(HAVE_SYS_ICU 1) - set(ICU_INCLUDEDIR "${CROSS_ROOTFS}/usr/local/include") - set(ICU_LIBDIR "${CROSS_ROOTFS}/usr/local/lib") -elseif(HOST_HAIKU) - set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations") - set(HAVE_SYS_ICU 1) -else() - message(FATAL_ERROR "Unknown host") -endif() - ###################################### # GC CHECKS ###################################### diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 3b0ade6bd89ccb..5bee7d724ad79c 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -297,9 +297,6 @@ <_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="TARGET_BUILD_ARCH=arm64" /> <_MonoBuildEnv Condition="'$(Platform)' == 'arm'" Include="TARGET_BUILD_ARCH=arm" /> <_MonoBuildEnv Condition="'$(Platform)' == 'armv6'" Include="TARGET_BUILD_ARCH=armv6" /> - <_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/aarch64-linux-gnu/pkgconfig" /> - <_MonoBuildEnv Condition="'$(Platform)' == 'arm'" Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/arm-linux-gnueabihf/pkgconfig" /> - <_MonoBuildEnv Condition="'$(Platform)' == 'armv6'" Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/arm-linux-gnueabihf/pkgconfig" /> <_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'armv6'" Include="-march=armv6zk" /> <_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'armv6'" Include="-mcpu=arm1176jzf-s" /> <_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'armv6'" Include="-mfpu=vfp" /> @@ -314,49 +311,42 @@ <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/boot/system/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x86" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=riscv64" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/riscv64-linux-gnu/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=s390x" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/s390x-linux-gnu/pkgconfig" /> <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> <_MonoBuildEnv Include="TARGET_BUILD_ARCH=ppc64le" /> - <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/powerpc64le-linux-gnu/pkgconfig" /> @@ -834,21 +824,6 @@ <_MonoAotBuildEnv Include="TARGET_BUILD_ARCH=$(AotHostArchitecture)" /> - - - <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/x86_64-linux-gnu/pkgconfig" /> - - - - - <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/aarch64-linux-gnu/pkgconfig" /> - - - - - <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> - - <_MonoAOTCFLAGSOption>-DCMAKE_C_FLAGS="@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCFLAGS, ' ')" <_MonoAOTCXXFLAGSOption>-DCMAKE_CXX_FLAGS="@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCXXFLAGS, ' ')" diff --git a/src/mono/mono/metadata/native-library.c b/src/mono/mono/metadata/native-library.c index 6692736251330d..f26ab2e9152afa 100644 --- a/src/mono/mono/metadata/native-library.c +++ b/src/mono/mono/metadata/native-library.c @@ -47,10 +47,6 @@ static GHashTable *native_library_module_map; */ static GHashTable *native_library_module_blocklist; -#ifndef NO_GLOBALIZATION_SHIM -extern const void *GlobalizationResolveDllImport (const char *name); -#endif - static GHashTable *global_module_map; // should only be accessed with the global loader data lock static MonoDl *internal_module; // used when pinvoking `__Internal` @@ -786,26 +782,6 @@ get_dllimportsearchpath_flags (MonoCustomAttrInfo *cinfo) return flags; } -#ifndef NO_GLOBALIZATION_SHIM -#ifdef HOST_WIN32 -#define GLOBALIZATION_DLL_NAME "System.Globalization.Native" -#else -#define GLOBALIZATION_DLL_NAME "libSystem.Globalization.Native" -#endif - -static gpointer -default_resolve_dllimport (const char *dll, const char *func) -{ - if (strcmp (dll, GLOBALIZATION_DLL_NAME) == 0) { - const void *method_impl = GlobalizationResolveDllImport (func); - if (method_impl) - return (gpointer)method_impl; - } - - return NULL; -} -#endif // NO_GLOBALIZATION_SHIM - gpointer lookup_pinvoke_call_impl (MonoMethod *method, MonoLookupPInvokeStatus *status_out) { @@ -881,12 +857,6 @@ lookup_pinvoke_call_impl (MonoMethod *method, MonoLookupPInvokeStatus *status_ou } #endif -#ifndef NO_GLOBALIZATION_SHIM - addr = default_resolve_dllimport (new_scope, new_import); - if (addr) - goto exit; -#endif - if (pinvoke_override) { addr = pinvoke_override (new_scope, new_import); if (addr) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 5e6ebe9ce49dc4..335867bac8eff6 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -45,78 +45,6 @@ if(HOST_WIN32) add_link_options(/OPT:NOICF) endif() -# ICU -if(HAVE_SYS_ICU) - if(STATIC_ICU) - set(pal_icushim_sources_base - pal_icushim_static.c) - add_definitions(-DSTATIC_ICU=1) - else() - set(pal_icushim_sources_base - pal_icushim.c) - endif() - - set(icu_shim_sources_base - pal_idna.c - pal_common.c - entrypoints.c - ${pal_icushim_sources_base}) - -if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) - set(icu_shim_sources_base - ${icu_shim_sources_base} - pal_calendarData.c - pal_casing.c - pal_collation.c - pal_locale.c - pal_localeNumberData.c - pal_localeStringData.c - pal_normalization.c - pal_timeZoneInfo.c - ) -endif() - -if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) - set(icu_shim_sources_base - ${icu_shim_sources_base} - pal_placeholders.c - ) -endif() - - addprefix(icu_shim_sources "${ICU_SHIM_PATH}" "${icu_shim_sources_base}") - - if (TARGET_DARWIN) - set(icu_shim_darwin_sources_base - pal_locale.m - pal_collation.m - pal_casing.m - pal_calendarData.m - pal_normalization.m - pal_timeZoneInfo.m) - - addprefix(icu_shim_darwin_sources "${ICU_SHIM_PATH}" "${icu_shim_darwin_sources_base}") - set(icu_shim_sources ${icu_shim_sources} ${icu_shim_darwin_sources}) - endif() - - set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_DEFINITIONS OSX_ICU_LIBRARY_PATH="${OSX_ICU_LIBRARY_PATH}") - set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_FLAGS "-I\"${ICU_INCLUDEDIR}\" -I\"${CLR_SRC_NATIVE_DIR}/libs/System.Globalization.Native/\" -I\"${CLR_SRC_NATIVE_DIR}/libs/Common/\" ${ICU_FLAGS}") - if(TARGET_DARWIN) - set_property(SOURCE ${icu_shim_darwin_sources} APPEND_STRING PROPERTY COMPILE_FLAGS " -fobjc-arc ${CLR_CMAKE_COMMON_OBJC_FLAGS}") - endif() - if(TARGET_WIN32) - set_source_files_properties(${icu_shim_sources} PROPERTIES LANGUAGE CXX) - endif() - if(ICU_LIBDIR) - set(ICU_LDFLAGS "-L${ICU_LIBDIR}") - endif() - if(CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) - set(ICU_LDFLAGS "-licucore") - endif() - - add_library(icu_shim_objects OBJECT "${icu_shim_sources}") - set(HAVE_ICU_SHIM 1) -endif() - # # MINI # From 2bc47daa65b32a18da9f830b35aab4243e4a4ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 22 Feb 2024 17:12:44 +0100 Subject: [PATCH 02/17] Remove last traces of icu code from the runtime --- src/mono/cmake/config.h.in | 3 --- src/mono/mono.proj | 6 ------ src/mono/mono/mini/CMakeLists.txt | 6 ------ 3 files changed, 15 deletions(-) diff --git a/src/mono/cmake/config.h.in b/src/mono/cmake/config.h.in index e484a802aed9b5..7fc03a4fd25a9b 100644 --- a/src/mono/cmake/config.h.in +++ b/src/mono/cmake/config.h.in @@ -183,9 +183,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNWIND_H 1 -/* Use static ICU */ -#cmakedefine STATIC_ICU 1 - /* Use in-tree zlib */ #cmakedefine INTERNAL_ZLIB 1 diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 5bee7d724ad79c..a5e78693d2fa21 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -80,7 +80,6 @@ - <_MonoCMakeArgs Include="-DENABLE_LLVM_RUNTIME=1"/> <_MonoCMakeArgs Include="-DEMSCRIPTEN_SYSTEM_PROCESSOR=wasm"/> - <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm-threads', 'native', 'include'))$(EscapedQuoteW)"/> - - <_MonoCFLAGS Condition="'$(WasmEnableThreads)' != 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm', 'native', 'include'))$(EscapedQuoteW)"/> @@ -451,8 +447,6 @@ <_MonoCFLAGS Include="-D_WASI_EMULATED_PROCESS_CLOCKS"/> <_MonoCFLAGS Include="-D_WASI_EMULATED_SIGNAL"/> <_MonoCFLAGS Include="-D_WASI_EMULATED_MMAN"/> - <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'wasi-wasm-threads', 'native', 'include').Replace('\','/'))$(EscapedQuoteW)"/> - <_MonoCFLAGS Condition="'$(WasmEnableThreads)' != 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'wasi-wasm', 'native', 'include').Replace('\','/'))$(EscapedQuoteW)"/> diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 335867bac8eff6..12d1ff859d06b5 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -379,9 +379,6 @@ if(NOT DISABLE_SHARED_LIBS) if(ICU_LDFLAGS) set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") endif() - if(NOT TARGET_WASM AND STATIC_ICU) - set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) - endif () if(TARGET_DARWIN) set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") endif() @@ -434,9 +431,6 @@ if(NOT DISABLE_SHARED_LIBS) if(ICU_LDFLAGS) set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") endif() - if(STATIC_ICU) - set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINKER_LANGUAGE CXX) - endif () set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") string(REPLACE "*" ";" componentsobjects-whitespace "${componentsobjects}") target_sources(${frameworkconfig} PRIVATE "${componentsobjects-whitespace}") From 13bbd3903d024e3114181068baa0dc97207e591d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 22 Feb 2024 17:27:12 +0100 Subject: [PATCH 03/17] Remove a few more icu-related logic --- src/mono/CMakeLists.txt | 3 --- src/mono/mono/eventpipe/test/CMakeLists.txt | 8 +------ src/mono/mono/mini/CMakeLists.txt | 26 ++++----------------- 3 files changed, 5 insertions(+), 32 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index e7db5576d3e5cf..b1ee21c3adf12a 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -124,7 +124,6 @@ endif() if(NOT AOT_TARGET_TRIPLE STREQUAL "") set(MONO_CROSS_COMPILE 1) - add_definitions(-DNO_GLOBALIZATION_SHIM) if(NOT AOT_OFFSETS_FILE STREQUAL "") set(MONO_OFFSETS_FILE "${AOT_OFFSETS_FILE}") endif() @@ -241,7 +240,6 @@ elseif(CLR_CMAKE_HOST_OS STREQUAL "android") # FIXME: Rest of the flags from configure.ac elseif(CLR_CMAKE_HOST_OS STREQUAL "emscripten") set(HOST_BROWSER 1) - add_definitions(-DNO_GLOBALIZATION_SHIM) add_definitions(-D_THREAD_SAFE) add_compile_options(-Wno-strict-prototypes) add_compile_options(-Wno-unused-but-set-variable) @@ -255,7 +253,6 @@ elseif(CLR_CMAKE_HOST_OS STREQUAL "emscripten") elseif(CLR_CMAKE_HOST_OS STREQUAL "wasi") set(HOST_WASI 1) add_definitions(-D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -DHOST_WASI) - add_definitions(-DNO_GLOBALIZATION_SHIM) add_definitions(-D_THREAD_SAFE) add_definitions(-DDISABLE_SOCKET_TRANSPORT) add_definitions(-DDISABLE_EGD_SOCKET) diff --git a/src/mono/mono/eventpipe/test/CMakeLists.txt b/src/mono/mono/eventpipe/test/CMakeLists.txt index d867685fb2da7a..d313e630adaaba 100644 --- a/src/mono/mono/eventpipe/test/CMakeLists.txt +++ b/src/mono/mono/eventpipe/test/CMakeLists.txt @@ -39,13 +39,7 @@ if(ENABLE_PERFTRACING) set(CMAKE_SKIP_RPATH 1) add_executable(ep-test ${EVENTPIPE_TEST_SOURCES} ${EVENTPIPE_TEST_HEADERS}) target_sources(ep-test PRIVATE "${mono-components-objects}") - target_link_libraries(ep-test PRIVATE eglib_api monosgen-static ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS} monoapi) - if(HAVE_SYS_ICU) - target_link_libraries(ep-test PRIVATE icu_shim_objects) - endif() - if(ICU_LDFLAGS) - set_target_properties(ep-test PROPERTIES LINK_FLAGS ${ICU_LDFLAGS}) - endif() + target_link_libraries(ep-test PRIVATE eglib_api monosgen-static ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS} monoapi) install_with_stripped_symbols(ep-test TARGETS bin) else(ENABLE_EVENTPIPE_TEST AND STATIC_COMPONENTS AND (NOT DISABLE_COMPONENTS) AND (NOT DISABLE_LIBS) AND (NOT DISABLE_EXECUTABLES)) message(VERBOSE "Skip building native EventPipe library test runner.") diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 12d1ff859d06b5..e81afefecfc239 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -1,6 +1,6 @@ project(mini C) -if(ENABLE_LLVM OR ENABLE_LLVM_RUNTIME OR HOST_BROWSER OR (HAVE_SYS_ICU AND NOT HOST_WASI)) +if(ENABLE_LLVM OR ENABLE_LLVM_RUNTIME OR HOST_BROWSER) enable_language(CXX) endif() @@ -362,9 +362,6 @@ if(NOT DISABLE_SHARED_LIBS) else() target_link_libraries(monosgen-shared PRIVATE monoapi eglib_objects utils_objects sgen_objects metadata_objects) endif() - if(HAVE_ICU_SHIM) - target_link_libraries(monosgen-shared PRIVATE icu_shim_objects) - endif() target_include_directories (monosgen-shared PRIVATE monoapi) if(TARGET_WIN32) # on Windows the import library for the shared mono library will have the same name as the static library, @@ -374,10 +371,7 @@ if(NOT DISABLE_SHARED_LIBS) if(CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) else() - target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) - endif() - if(ICU_LDFLAGS) - set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") + target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) endif() if(TARGET_DARWIN) set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") @@ -423,14 +417,8 @@ if(NOT DISABLE_SHARED_LIBS) add_library(${frameworkconfig} SHARED $) target_compile_definitions(${frameworkconfig} PRIVATE -DMONO_DLL_EXPORT) target_link_libraries(${frameworkconfig} PRIVATE monoapi eglib_objects utils_objects sgen_objects metadata_objects) - if(HAVE_ICU_SHIM) - target_link_libraries(${frameworkconfig} PRIVATE icu_shim_objects) - endif() - target_link_libraries(${frameworkconfig} PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) + target_link_libraries(${frameworkconfig} PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) - if(ICU_LDFLAGS) - set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") - endif() set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0") string(REPLACE "*" ";" componentsobjects-whitespace "${componentsobjects}") target_sources(${frameworkconfig} PRIVATE "${componentsobjects-whitespace}") @@ -549,10 +537,7 @@ if(NOT DISABLE_EXECUTABLES) if (HOST_WASM) target_link_libraries(mono-sgen PRIVATE mono-wasm-nosimd) endif() - if(HAVE_ICU_SHIM) - target_link_libraries(mono-sgen PRIVATE icu_shim_objects) - endif() - target_link_libraries(mono-sgen PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) + target_link_libraries(mono-sgen PRIVATE ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS}) # musl-libc implements ucontext in a different library on s390x if(CLR_CMAKE_TARGET_LINUX_MUSL AND TARGET_S390X) target_link_libraries(mono-sgen PRIVATE ucontext) @@ -571,9 +556,6 @@ if(NOT DISABLE_EXECUTABLES) # if components are disabled, link the fallback stubs into the runtime # fallback stubs already provided in monosgen-static when components are disabled endif() - if(ICU_LDFLAGS) - set_property(TARGET mono-sgen APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") - endif() if(CMAKE_BUILD_TYPE STREQUAL "Debug") target_sources(mono-sgen PRIVATE ${mono_validate_apis_source}) From 7c018d908603f3c7b9a922ef28b7deed13e4fcc6 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 26 Feb 2024 10:26:17 +0100 Subject: [PATCH 04/17] revert back _MonoCFlags for wasm --- src/mono/mono.proj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index a5e78693d2fa21..82b7f698a7088f 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -433,6 +433,8 @@ <_MonoCMakeArgs Include="-DENABLE_LLVM_RUNTIME=1"/> <_MonoCMakeArgs Include="-DEMSCRIPTEN_SYSTEM_PROCESSOR=wasm"/> + <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm-threads', 'native', 'include'))$(EscapedQuoteW)"/> + <_MonoCFLAGS Condition="'$(WasmEnableThreads)' != 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm', 'native', 'include'))$(EscapedQuoteW)"/> From 89eb51f68b8b0cceba395873487ef8bb5a8265be Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 26 Feb 2024 11:41:53 +0100 Subject: [PATCH 05/17] remove icu related code --- src/mono/mono.proj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 82b7f698a7088f..a5e78693d2fa21 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -433,8 +433,6 @@ <_MonoCMakeArgs Include="-DENABLE_LLVM_RUNTIME=1"/> <_MonoCMakeArgs Include="-DEMSCRIPTEN_SYSTEM_PROCESSOR=wasm"/> - <_MonoCFLAGS Condition="'$(WasmEnableThreads)' == 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm-threads', 'native', 'include'))$(EscapedQuoteW)"/> - <_MonoCFLAGS Condition="'$(WasmEnableThreads)' != 'true'" Include="$(EscapedQuoteW)-I$([MSBuild]::NormalizePath('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm', 'native', 'include'))$(EscapedQuoteW)"/> From f2593d1081794f8d489628b9ec3d61d1a5b1168e Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Thu, 29 Feb 2024 17:40:34 +0100 Subject: [PATCH 06/17] Fix windows failure --- .../CMakeLists.txt | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 1959fec40a7cfd..ba3983ae6ab9f4 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,21 +183,19 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - if(STATIC_LIBS_ONLY) - add_library(System.Globalization.Native.Aot - STATIC - ${NATIVEGLOBALIZATION_SOURCES} - ) - set_target_properties(System.Globalization.Native.Aot PROPERTIES CLR_CONTROL_FLOW_GUARD OFF) - set_target_properties(System.Globalization.Native.Aot PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) + add_library(System.Globalization.Native.Aot + STATIC + ${NATIVEGLOBALIZATION_SOURCES} + ) + set_target_properties(System.Globalization.Native.Aot PROPERTIES CLR_CONTROL_FLOW_GUARD OFF) + set_target_properties(System.Globalization.Native.Aot PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) - add_library(System.Globalization.Native.Aot.GuardCF - STATIC - ${NATIVEGLOBALIZATION_SOURCES} - ) - set_target_properties(System.Globalization.Native.Aot.GuardCF PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) + add_library(System.Globalization.Native.Aot.GuardCF + STATIC + ${NATIVEGLOBALIZATION_SOURCES} + ) + set_target_properties(System.Globalization.Native.Aot.GuardCF PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) - install_static_library(System.Globalization.Native.Aot aotsdk nativeaot) - install_static_library(System.Globalization.Native.Aot.GuardCF aotsdk nativeaot) - endif() + install_static_library(System.Globalization.Native.Aot aotsdk nativeaot) + install_static_library(System.Globalization.Native.Aot.GuardCF aotsdk nativeaot) endif() From 8d8c51125ab72ae4ffa7570bf9b2eb9635f14361 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Fri, 1 Mar 2024 12:33:56 +0100 Subject: [PATCH 07/17] Fix windows build --- src/native/libs/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index 79b92e33da29e7..cba0ce782610e5 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -97,11 +97,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) endif () else () set(CMAKE_SHARED_LIBRARY_PREFIX "") - - # we only need to build System.Globalization.Native when building static libs. - if (STATIC_LIBS_ONLY) - add_subdirectory(System.Globalization.Native) - endif () + add_subdirectory(System.Globalization.Native) endif () add_subdirectory(System.IO.Compression.Native) From da55a25b48e837637f86ee96931765d57491d283 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 14:44:01 +0100 Subject: [PATCH 08/17] bring back STATIC_LIBS_ONLY check --- .../CMakeLists.txt | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index ba3983ae6ab9f4..1959fec40a7cfd 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -183,19 +183,21 @@ if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE endif() if(CLR_CMAKE_TARGET_WIN32) - add_library(System.Globalization.Native.Aot - STATIC - ${NATIVEGLOBALIZATION_SOURCES} - ) - set_target_properties(System.Globalization.Native.Aot PROPERTIES CLR_CONTROL_FLOW_GUARD OFF) - set_target_properties(System.Globalization.Native.Aot PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) + if(STATIC_LIBS_ONLY) + add_library(System.Globalization.Native.Aot + STATIC + ${NATIVEGLOBALIZATION_SOURCES} + ) + set_target_properties(System.Globalization.Native.Aot PROPERTIES CLR_CONTROL_FLOW_GUARD OFF) + set_target_properties(System.Globalization.Native.Aot PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) - add_library(System.Globalization.Native.Aot.GuardCF - STATIC - ${NATIVEGLOBALIZATION_SOURCES} - ) - set_target_properties(System.Globalization.Native.Aot.GuardCF PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) + add_library(System.Globalization.Native.Aot.GuardCF + STATIC + ${NATIVEGLOBALIZATION_SOURCES} + ) + set_target_properties(System.Globalization.Native.Aot.GuardCF PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) - install_static_library(System.Globalization.Native.Aot aotsdk nativeaot) - install_static_library(System.Globalization.Native.Aot.GuardCF aotsdk nativeaot) + install_static_library(System.Globalization.Native.Aot aotsdk nativeaot) + install_static_library(System.Globalization.Native.Aot.GuardCF aotsdk nativeaot) + endif() endif() From d86b67be23705467c9e05ca9f0d5e6db3f91b4a8 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 5 Mar 2024 16:33:41 +0100 Subject: [PATCH 09/17] test --- .../CMakeLists.txt | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 1959fec40a7cfd..1c2a989becd73f 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.10..3.20) project(System.Globalization.Native C) +if (CLR_CMAKE_TARGET_WIN32) + enable_language(CXX) +endif() + if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) if (ANDROID_FORCE_ICU_DATA_DIR) add_definitions(-DANDROID_FORCE_ICU_DATA_DIR) @@ -143,11 +147,19 @@ if (GEN_SHARED_LIB) find_library(FOUNDATION Foundation REQUIRED) endif() - add_library(System.Globalization.Native - SHARED - ${NATIVEGLOBALIZATION_SOURCES} - ${VERSION_FILE_PATH} - ) + if (CLR_CMAKE_TARGET_WIN32) + add_library(System.Globalization.Native + SHARED + ${NATIVEGLOBALIZATION_SOURCES} + ${VERSION_HEADER_PATH} + ) + else() + add_library(System.Globalization.Native + SHARED + ${NATIVEGLOBALIZATION_SOURCES} + ${VERSION_FILE_PATH} + ) + endif() target_link_libraries(System.Globalization.Native PRIVATE From ab250742da631f4bde3ec4003339ef6cd47bc468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Wed, 6 Mar 2024 12:30:05 +0100 Subject: [PATCH 10/17] Make System.Globalization.Native compile as C on recent MSVC We can now use __typeof__ in recent MSVC and some small tweaks to how the function pointers are defined. Also fix the PDB not getting copied next to the .dll and disable validating the .so file which doesn't apply to Windows. --- src/native/libs/Common/pal_compiler.h | 4 + .../CMakeLists.txt | 18 +- .../pal_collation.c | 2 +- .../pal_icushim_internal.h | 216 +++++++++--------- 4 files changed, 123 insertions(+), 117 deletions(-) diff --git a/src/native/libs/Common/pal_compiler.h b/src/native/libs/Common/pal_compiler.h index 31d45a0c385be1..876dd6adad2de7 100644 --- a/src/native/libs/Common/pal_compiler.h +++ b/src/native/libs/Common/pal_compiler.h @@ -77,6 +77,10 @@ do_abort_unless (bool condition, const char* fmt, ...) #ifdef __cplusplus #define TYPEOF decltype #else +#ifdef _MSC_VER +#define TYPEOF __typeof__ +#else #define TYPEOF __typeof +#endif // _MSVC_VER #endif // __cplusplus #endif // TYPEOF diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 1c2a989becd73f..68258d32656d31 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -3,10 +3,6 @@ cmake_minimum_required(VERSION 3.10..3.20) project(System.Globalization.Native C) -if (CLR_CMAKE_TARGET_WIN32) - enable_language(CXX) -endif() - if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI) if (ANDROID_FORCE_ICU_DATA_DIR) add_definitions(-DANDROID_FORCE_ICU_DATA_DIR) @@ -135,8 +131,9 @@ if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI AND NOT CLR_CMAKE set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_timeZoneInfo.c) endif() -if (MSVC) - set_source_files_properties(${NATIVEGLOBALIZATION_SOURCES} PROPERTIES LANGUAGE CXX) +if (MSVC AND MSVC_VERSION LESS 1939) + # on VS < 17.9 we need to force compile sources as C++ since msvc doesn't support __typeof__ there + set_source_files_properties(${NATIVEGLOBALIZATION_SOURCES} PROPERTIES COMPILE_FLAGS "/TP") endif() include_directories("../Common") @@ -167,7 +164,12 @@ if (GEN_SHARED_LIB) ${FOUNDATION} ) - install_with_stripped_symbols (System.Globalization.Native PROGRAMS .) + if(CLR_CMAKE_TARGET_WIN32) + install (TARGETS System.Globalization.Native DESTINATION .) + install (FILES $ DESTINATION .) + else() + install_with_stripped_symbols (System.Globalization.Native PROGRAMS .) + endif() endif() add_library(System.Globalization.Native-Static @@ -182,7 +184,7 @@ endif() install (TARGETS System.Globalization.Native-Static DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs) -if(NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_LINUX_MUSL AND NOT CLR_CMAKE_TARGET_HAIKU) +if(NOT CLR_CMAKE_TARGET_WIN32 AND NOT CLR_CMAKE_TARGET_APPLE AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_LINUX_MUSL AND NOT CLR_CMAKE_TARGET_HAIKU) if (GEN_SHARED_LIB) add_custom_command(TARGET System.Globalization.Native POST_BUILD COMMENT "Verifying System.Globalization.Native.so dependencies" diff --git a/src/native/libs/System.Globalization.Native/pal_collation.c b/src/native/libs/System.Globalization.Native/pal_collation.c index 44de265b4a196d..d6e4be28da3a4b 100644 --- a/src/native/libs/System.Globalization.Native/pal_collation.c +++ b/src/native/libs/System.Globalization.Native/pal_collation.c @@ -252,7 +252,7 @@ static void FillIgnoreWidthRules(UChar* completeRules, int32_t* fillIndex, int32 if (isIgnoreCase && (!isIgnoreWidth)) { assert((*fillIndex) + (FullWidthAlphabetRangeLength * 4) <= completeRulesLength); - const int UpperCaseToLowerCaseOffset = 0xFF41 - 0xFF21; + const UChar UpperCaseToLowerCaseOffset = 0xFF41 - 0xFF21; for (UChar ch = 0xFF21; ch <= 0xFF3A; ch++) { diff --git a/src/native/libs/System.Globalization.Native/pal_icushim_internal.h b/src/native/libs/System.Globalization.Native/pal_icushim_internal.h index a7bad69cef3197..4dcf73a3a42a74 100644 --- a/src/native/libs/System.Globalization.Native/pal_icushim_internal.h +++ b/src/native/libs/System.Globalization.Native/pal_icushim_internal.h @@ -232,114 +232,114 @@ FOR_ALL_ICU_FUNCTIONS // Redefine all calls to ICU functions as calls through pointers that are set // to the functions of the selected version of ICU in the initialization. -#define u_charsToUChars(...) u_charsToUChars_ptr(__VA_ARGS__) -#define u_getVersion(...) u_getVersion_ptr(__VA_ARGS__) -#define u_strcmp(...) u_strcmp_ptr(__VA_ARGS__) -#define u_strcpy(...) u_strcpy_ptr(__VA_ARGS__) -#define u_strlen(...) u_strlen_ptr(__VA_ARGS__) -#define u_strncpy(...) u_strncpy_ptr(__VA_ARGS__) -#define u_tolower(...) u_tolower_ptr(__VA_ARGS__) -#define u_toupper(...) u_toupper_ptr(__VA_ARGS__) -#define u_uastrncpy(...) u_uastrncpy_ptr(__VA_ARGS__) -#define ubrk_close(...) ubrk_close_ptr(__VA_ARGS__) -#define ubrk_openRules(...) ubrk_openRules_ptr(__VA_ARGS__) -#define ucal_add(...) ucal_add_ptr(__VA_ARGS__) -#define ucal_close(...) ucal_close_ptr(__VA_ARGS__) -#define ucal_get(...) ucal_get_ptr(__VA_ARGS__) -#define ucal_getAttribute(...) ucal_getAttribute_ptr(__VA_ARGS__) -#define ucal_getKeywordValuesForLocale(...) ucal_getKeywordValuesForLocale_ptr(__VA_ARGS__) -#define ucal_getLimit(...) ucal_getLimit_ptr(__VA_ARGS__) -#define ucal_getNow(...) ucal_getNow_ptr(__VA_ARGS__) -#define ucal_getTimeZoneDisplayName(...) ucal_getTimeZoneDisplayName_ptr(__VA_ARGS__) -#define ucal_getTimeZoneIDForWindowsID(...) ucal_getTimeZoneIDForWindowsID_ptr(__VA_ARGS__) -#define ucal_getWindowsTimeZoneID(...) ucal_getWindowsTimeZoneID_ptr(__VA_ARGS__) -#define ucal_open(...) ucal_open_ptr(__VA_ARGS__) -#define ucal_openTimeZoneIDEnumeration(...) ucal_openTimeZoneIDEnumeration_ptr(__VA_ARGS__) -#define ucal_set(...) ucal_set_ptr(__VA_ARGS__) -#define ucal_setMillis(...) ucal_setMillis_ptr(__VA_ARGS__) -#define ucol_clone(...) ucol_clone_ptr(__VA_ARGS__) -#define ucol_close(...) ucol_close_ptr(__VA_ARGS__) -#define ucol_closeElements(...) ucol_closeElements_ptr(__VA_ARGS__) -#define ucol_getOffset(...) ucol_getOffset_ptr(__VA_ARGS__) -#define ucol_getRules(...) ucol_getRules_ptr(__VA_ARGS__) -#define ucol_getSortKey(...) ucol_getSortKey_ptr(__VA_ARGS__) -#define ucol_getStrength(...) ucol_getStrength_ptr(__VA_ARGS__) -#define ucol_getVersion(...) ucol_getVersion_ptr(__VA_ARGS__) -#define ucol_next(...) ucol_next_ptr(__VA_ARGS__) -#define ucol_previous(...) ucol_previous_ptr(__VA_ARGS__) -#define ucol_open(...) ucol_open_ptr(__VA_ARGS__) -#define ucol_openElements(...) ucol_openElements_ptr(__VA_ARGS__) -#define ucol_openRules(...) ucol_openRules_ptr(__VA_ARGS__) -#define ucol_setAttribute(...) ucol_setAttribute_ptr(__VA_ARGS__) -#define ucol_setMaxVariable(...) ucol_setMaxVariable_ptr(__VA_ARGS__) -#define ucol_strcoll(...) ucol_strcoll_ptr(__VA_ARGS__) -#define ucurr_forLocale(...) ucurr_forLocale_ptr(__VA_ARGS__) -#define ucurr_getName(...) ucurr_getName_ptr(__VA_ARGS__) -#define udat_close(...) udat_close_ptr(__VA_ARGS__) -#define udat_countSymbols(...) udat_countSymbols_ptr(__VA_ARGS__) -#define udat_format(...) udat_format_ptr(__VA_ARGS__) -#define udat_getSymbols(...) udat_getSymbols_ptr(__VA_ARGS__) -#define udat_open(...) udat_open_ptr(__VA_ARGS__) -#define udat_setCalendar(...) udat_setCalendar_ptr(__VA_ARGS__) -#define udat_toPattern(...) udat_toPattern_ptr(__VA_ARGS__) -#define udatpg_close(...) udatpg_close_ptr(__VA_ARGS__) -#define udatpg_getBestPattern(...) udatpg_getBestPattern_ptr(__VA_ARGS__) -#define udatpg_open(...) udatpg_open_ptr(__VA_ARGS__) -#define uenum_close(...) uenum_close_ptr(__VA_ARGS__) -#define uenum_count(...) uenum_count_ptr(__VA_ARGS__) -#define uenum_next(...) uenum_next_ptr(__VA_ARGS__) -#define uidna_close(...) uidna_close_ptr(__VA_ARGS__) -#define uidna_nameToASCII(...) uidna_nameToASCII_ptr(__VA_ARGS__) -#define uidna_nameToUnicode(...) uidna_nameToUnicode_ptr(__VA_ARGS__) -#define uidna_openUTS46(...) uidna_openUTS46_ptr(__VA_ARGS__) -#define uldn_close(...) uldn_close_ptr(__VA_ARGS__) -#define uldn_keyValueDisplayName(...) uldn_keyValueDisplayName_ptr(__VA_ARGS__) -#define uldn_open(...) uldn_open_ptr(__VA_ARGS__) -#define uloc_canonicalize(...) uloc_canonicalize_ptr(__VA_ARGS__) -#define uloc_countAvailable(...) uloc_countAvailable_ptr(__VA_ARGS__) -#define uloc_getAvailable(...) uloc_getAvailable_ptr(__VA_ARGS__) -#define uloc_getBaseName(...) uloc_getBaseName_ptr(__VA_ARGS__) -#define uloc_getCharacterOrientation(...) uloc_getCharacterOrientation_ptr(__VA_ARGS__) -#define uloc_getCountry(...) uloc_getCountry_ptr(__VA_ARGS__) -#define uloc_getDefault(...) uloc_getDefault_ptr(__VA_ARGS__) -#define uloc_getDisplayCountry(...) uloc_getDisplayCountry_ptr(__VA_ARGS__) -#define uloc_getDisplayLanguage(...) uloc_getDisplayLanguage_ptr(__VA_ARGS__) -#define uloc_getDisplayName(...) uloc_getDisplayName_ptr(__VA_ARGS__) -#define uloc_getISO3Country(...) uloc_getISO3Country_ptr(__VA_ARGS__) -#define uloc_getISO3Language(...) uloc_getISO3Language_ptr(__VA_ARGS__) -#define uloc_getKeywordValue(...) uloc_getKeywordValue_ptr(__VA_ARGS__) -#define uloc_getLanguage(...) uloc_getLanguage_ptr(__VA_ARGS__) -#define uloc_getLCID(...) uloc_getLCID_ptr(__VA_ARGS__) -#define uloc_getName(...) uloc_getName_ptr(__VA_ARGS__) -#define uloc_getParent(...) uloc_getParent_ptr(__VA_ARGS__) -#define uloc_setKeywordValue(...) uloc_setKeywordValue_ptr(__VA_ARGS__) -#define ulocdata_getCLDRVersion(...) ulocdata_getCLDRVersion_ptr(__VA_ARGS__) -#define ulocdata_getMeasurementSystem(...) ulocdata_getMeasurementSystem_ptr(__VA_ARGS__) -#define unorm2_getNFCInstance(...) unorm2_getNFCInstance_ptr(__VA_ARGS__) -#define unorm2_getNFDInstance(...) unorm2_getNFDInstance_ptr(__VA_ARGS__) -#define unorm2_getNFKCInstance(...) unorm2_getNFKCInstance_ptr(__VA_ARGS__) -#define unorm2_getNFKDInstance(...) unorm2_getNFKDInstance_ptr(__VA_ARGS__) -#define unorm2_isNormalized(...) unorm2_isNormalized_ptr(__VA_ARGS__) -#define unorm2_normalize(...) unorm2_normalize_ptr(__VA_ARGS__) -#define unum_close(...) unum_close_ptr(__VA_ARGS__) -#define unum_getAttribute(...) unum_getAttribute_ptr(__VA_ARGS__) -#define unum_getSymbol(...) unum_getSymbol_ptr(__VA_ARGS__) -#define unum_open(...) unum_open_ptr(__VA_ARGS__) -#define unum_toPattern(...) unum_toPattern_ptr(__VA_ARGS__) -#define ures_close(...) ures_close_ptr(__VA_ARGS__) -#define ures_getByKey(...) ures_getByKey_ptr(__VA_ARGS__) -#define ures_getSize(...) ures_getSize_ptr(__VA_ARGS__) -#define ures_getStringByIndex(...) ures_getStringByIndex_ptr(__VA_ARGS__) -#define ures_open(...) ures_open_ptr(__VA_ARGS__) -#define usearch_close(...) usearch_close_ptr(__VA_ARGS__) -#define usearch_first(...) usearch_first_ptr(__VA_ARGS__) -#define usearch_getBreakIterator(...) usearch_getBreakIterator_ptr(__VA_ARGS__) -#define usearch_getMatchedLength(...) usearch_getMatchedLength_ptr(__VA_ARGS__) -#define usearch_last(...) usearch_last_ptr(__VA_ARGS__) -#define usearch_openFromCollator(...) usearch_openFromCollator_ptr(__VA_ARGS__) -#define usearch_reset(...) usearch_reset_ptr(__VA_ARGS__) -#define usearch_setPattern(...) usearch_setPattern_ptr(__VA_ARGS__) -#define usearch_setText(...) usearch_setText_ptr(__VA_ARGS__) +#define u_charsToUChars(...) (*u_charsToUChars_ptr)(__VA_ARGS__) +#define u_getVersion(...) (*u_getVersion_ptr)(__VA_ARGS__) +#define u_strcmp(...) (*u_strcmp_ptr)(__VA_ARGS__) +#define u_strcpy(...) (*u_strcpy_ptr)(__VA_ARGS__) +#define u_strlen(...) (*u_strlen_ptr)(__VA_ARGS__) +#define u_strncpy(...) (*u_strncpy_ptr)(__VA_ARGS__) +#define u_tolower(...) (*u_tolower_ptr)(__VA_ARGS__) +#define u_toupper(...) (*u_toupper_ptr)(__VA_ARGS__) +#define u_uastrncpy(...) (*u_uastrncpy_ptr)(__VA_ARGS__) +#define ubrk_close(...) (*ubrk_close_ptr)(__VA_ARGS__) +#define ubrk_openRules(...) (*ubrk_openRules_ptr)(__VA_ARGS__) +#define ucal_add(...) (*ucal_add_ptr)(__VA_ARGS__) +#define ucal_close(...) (*ucal_close_ptr)(__VA_ARGS__) +#define ucal_get(...) (*ucal_get_ptr)(__VA_ARGS__) +#define ucal_getAttribute(...) (*ucal_getAttribute_ptr)(__VA_ARGS__) +#define ucal_getKeywordValuesForLocale(...) (*ucal_getKeywordValuesForLocale_ptr)(__VA_ARGS__) +#define ucal_getLimit(...) (*ucal_getLimit_ptr)(__VA_ARGS__) +#define ucal_getNow(...) (*ucal_getNow_ptr)(__VA_ARGS__) +#define ucal_getTimeZoneDisplayName(...) (*ucal_getTimeZoneDisplayName_ptr)(__VA_ARGS__) +#define ucal_getTimeZoneIDForWindowsID(...) (*ucal_getTimeZoneIDForWindowsID_ptr)(__VA_ARGS__) +#define ucal_getWindowsTimeZoneID(...) (*ucal_getWindowsTimeZoneID_ptr)(__VA_ARGS__) +#define ucal_open(...) (*ucal_open_ptr)(__VA_ARGS__) +#define ucal_openTimeZoneIDEnumeration(...) (*ucal_openTimeZoneIDEnumeration_ptr)(__VA_ARGS__) +#define ucal_set(...) (*ucal_set_ptr)(__VA_ARGS__) +#define ucal_setMillis(...) (*ucal_setMillis_ptr)(__VA_ARGS__) +#define ucol_clone(...) (*ucol_clone_ptr)(__VA_ARGS__) +#define ucol_close(...) (*ucol_close_ptr)(__VA_ARGS__) +#define ucol_closeElements(...) (*ucol_closeElements_ptr)(__VA_ARGS__) +#define ucol_getOffset(...) (*ucol_getOffset_ptr)(__VA_ARGS__) +#define ucol_getRules(...) (*ucol_getRules_ptr)(__VA_ARGS__) +#define ucol_getSortKey(...) (*ucol_getSortKey_ptr)(__VA_ARGS__) +#define ucol_getStrength(...) (*ucol_getStrength_ptr)(__VA_ARGS__) +#define ucol_getVersion(...) (*ucol_getVersion_ptr)(__VA_ARGS__) +#define ucol_next(...) (*ucol_next_ptr)(__VA_ARGS__) +#define ucol_previous(...) (*ucol_previous_ptr)(__VA_ARGS__) +#define ucol_open(...) (*ucol_open_ptr)(__VA_ARGS__) +#define ucol_openElements(...) (*ucol_openElements_ptr)(__VA_ARGS__) +#define ucol_openRules(...) (*ucol_openRules_ptr)(__VA_ARGS__) +#define ucol_setAttribute(...) (*ucol_setAttribute_ptr)(__VA_ARGS__) +#define ucol_setMaxVariable(...) (*ucol_setMaxVariable_ptr)(__VA_ARGS__) +#define ucol_strcoll(...) (*ucol_strcoll_ptr)(__VA_ARGS__) +#define ucurr_forLocale(...) (*ucurr_forLocale_ptr)(__VA_ARGS__) +#define ucurr_getName(...) (*ucurr_getName_ptr)(__VA_ARGS__) +#define udat_close(...) (*udat_close_ptr)(__VA_ARGS__) +#define udat_countSymbols(...) (*udat_countSymbols_ptr)(__VA_ARGS__) +#define udat_format(...) (*udat_format_ptr)(__VA_ARGS__) +#define udat_getSymbols(...) (*udat_getSymbols_ptr)(__VA_ARGS__) +#define udat_open(...) (*udat_open_ptr)(__VA_ARGS__) +#define udat_setCalendar(...) (*udat_setCalendar_ptr)(__VA_ARGS__) +#define udat_toPattern(...) (*udat_toPattern_ptr)(__VA_ARGS__) +#define udatpg_close(...) (*udatpg_close_ptr)(__VA_ARGS__) +#define udatpg_getBestPattern(...) (*udatpg_getBestPattern_ptr)(__VA_ARGS__) +#define udatpg_open(...) (*udatpg_open_ptr)(__VA_ARGS__) +#define uenum_close(...) (*uenum_close_ptr)(__VA_ARGS__) +#define uenum_count(...) (*uenum_count_ptr)(__VA_ARGS__) +#define uenum_next(...) (*uenum_next_ptr)(__VA_ARGS__) +#define uidna_close(...) (*uidna_close_ptr)(__VA_ARGS__) +#define uidna_nameToASCII(...) (*uidna_nameToASCII_ptr)(__VA_ARGS__) +#define uidna_nameToUnicode(...) (*uidna_nameToUnicode_ptr)(__VA_ARGS__) +#define uidna_openUTS46(...) (*uidna_openUTS46_ptr)(__VA_ARGS__) +#define uldn_close(...) (*uldn_close_ptr)(__VA_ARGS__) +#define uldn_keyValueDisplayName(...) (*uldn_keyValueDisplayName_ptr)(__VA_ARGS__) +#define uldn_open(...) (*uldn_open_ptr)(__VA_ARGS__) +#define uloc_canonicalize(...) (*uloc_canonicalize_ptr)(__VA_ARGS__) +#define uloc_countAvailable(...) (*uloc_countAvailable_ptr)(__VA_ARGS__) +#define uloc_getAvailable(...) (*uloc_getAvailable_ptr)(__VA_ARGS__) +#define uloc_getBaseName(...) (*uloc_getBaseName_ptr)(__VA_ARGS__) +#define uloc_getCharacterOrientation(...) (*uloc_getCharacterOrientation_ptr)(__VA_ARGS__) +#define uloc_getCountry(...) (*uloc_getCountry_ptr)(__VA_ARGS__) +#define uloc_getDefault(...) (*uloc_getDefault_ptr)(__VA_ARGS__) +#define uloc_getDisplayCountry(...) (*uloc_getDisplayCountry_ptr)(__VA_ARGS__) +#define uloc_getDisplayLanguage(...) (*uloc_getDisplayLanguage_ptr)(__VA_ARGS__) +#define uloc_getDisplayName(...) (*uloc_getDisplayName_ptr)(__VA_ARGS__) +#define uloc_getISO3Country(...) (*uloc_getISO3Country_ptr)(__VA_ARGS__) +#define uloc_getISO3Language(...) (*uloc_getISO3Language_ptr)(__VA_ARGS__) +#define uloc_getKeywordValue(...) (*uloc_getKeywordValue_ptr)(__VA_ARGS__) +#define uloc_getLanguage(...) (*uloc_getLanguage_ptr)(__VA_ARGS__) +#define uloc_getLCID(...) (*uloc_getLCID_ptr)(__VA_ARGS__) +#define uloc_getName(...) (*uloc_getName_ptr)(__VA_ARGS__) +#define uloc_getParent(...) (*uloc_getParent_ptr)(__VA_ARGS__) +#define uloc_setKeywordValue(...) (*uloc_setKeywordValue_ptr)(__VA_ARGS__) +#define ulocdata_getCLDRVersion(...) (*ulocdata_getCLDRVersion_ptr)(__VA_ARGS__) +#define ulocdata_getMeasurementSystem(...) (*ulocdata_getMeasurementSystem_ptr)(__VA_ARGS__) +#define unorm2_getNFCInstance(...) (*unorm2_getNFCInstance_ptr)(__VA_ARGS__) +#define unorm2_getNFDInstance(...) (*unorm2_getNFDInstance_ptr)(__VA_ARGS__) +#define unorm2_getNFKCInstance(...) (*unorm2_getNFKCInstance_ptr)(__VA_ARGS__) +#define unorm2_getNFKDInstance(...) (*unorm2_getNFKDInstance_ptr)(__VA_ARGS__) +#define unorm2_isNormalized(...) (*unorm2_isNormalized_ptr)(__VA_ARGS__) +#define unorm2_normalize(...) (*unorm2_normalize_ptr)(__VA_ARGS__) +#define unum_close(...) (*unum_close_ptr)(__VA_ARGS__) +#define unum_getAttribute(...) (*unum_getAttribute_ptr)(__VA_ARGS__) +#define unum_getSymbol(...) (*unum_getSymbol_ptr)(__VA_ARGS__) +#define unum_open(...) (*unum_open_ptr)(__VA_ARGS__) +#define unum_toPattern(...) (*unum_toPattern_ptr)(__VA_ARGS__) +#define ures_close(...) (*ures_close_ptr)(__VA_ARGS__) +#define ures_getByKey(...) (*ures_getByKey_ptr)(__VA_ARGS__) +#define ures_getSize(...) (*ures_getSize_ptr)(__VA_ARGS__) +#define ures_getStringByIndex(...) (*ures_getStringByIndex_ptr)(__VA_ARGS__) +#define ures_open(...) (*ures_open_ptr)(__VA_ARGS__) +#define usearch_close(...) (*usearch_close_ptr)(__VA_ARGS__) +#define usearch_first(...) (*usearch_first_ptr)(__VA_ARGS__) +#define usearch_getBreakIterator(...) (*usearch_getBreakIterator_ptr)(__VA_ARGS__) +#define usearch_getMatchedLength(...) (*usearch_getMatchedLength_ptr)(__VA_ARGS__) +#define usearch_last(...) (*usearch_last_ptr)(__VA_ARGS__) +#define usearch_openFromCollator(...) (*usearch_openFromCollator_ptr)(__VA_ARGS__) +#define usearch_reset(...) (*usearch_reset_ptr)(__VA_ARGS__) +#define usearch_setPattern(...) (*usearch_setPattern_ptr)(__VA_ARGS__) +#define usearch_setText(...) (*usearch_setText_ptr)(__VA_ARGS__) #else // !defined(STATIC_ICU) From f06fb021b5f45c0771fa8c2b7ab71914b842f145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Wed, 6 Mar 2024 13:14:06 +0100 Subject: [PATCH 11/17] Fix compiler warning --- .../libs/System.Globalization.Native/pal_localeNumberData.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/System.Globalization.Native/pal_localeNumberData.c b/src/native/libs/System.Globalization.Native/pal_localeNumberData.c index c0996e373317ee..1cc0e55d188b17 100644 --- a/src/native/libs/System.Globalization.Native/pal_localeNumberData.c +++ b/src/native/libs/System.Globalization.Native/pal_localeNumberData.c @@ -165,7 +165,7 @@ static int GetNumericPattern(const UNumberFormat* pNumberFormat, int isNegative) { const int INVALID_FORMAT = -1; - const int MAX_DOTNET_NUMERIC_PATTERN_LENGTH = 6; // example: "(C n)" plus terminator + const size_t MAX_DOTNET_NUMERIC_PATTERN_LENGTH = 6; // example: "(C n)" plus terminator UErrorCode ignore = U_ZERO_ERROR; int32_t icuPatternLength = unum_toPattern(pNumberFormat, false, NULL, 0, &ignore) + 1; From 17f917163b9195808d49ca709028a218567e45a9 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Thu, 7 Mar 2024 12:26:01 +0100 Subject: [PATCH 12/17] fix .dll version and add in runtime pack --- .../pkg/sfx/Microsoft.NETCore.App/Directory.Build.props | 1 + src/native/libs/System.Globalization.Native/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props index 4a1a720cf6a0d3..aedd89c6147dfa 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props @@ -128,6 +128,7 @@ + diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 68258d32656d31..3eb4e68f3ac832 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -145,10 +145,11 @@ if (GEN_SHARED_LIB) endif() if (CLR_CMAKE_TARGET_WIN32) + add_definitions(-DVER_FILEDESCRIPTION_STR="System.Globalization.Native") add_library(System.Globalization.Native SHARED ${NATIVEGLOBALIZATION_SOURCES} - ${VERSION_HEADER_PATH} + ${VERSION_FILE_RC_PATH} ) else() add_library(System.Globalization.Native From 25f7ce10db5998c32c9ac3324fee08c923eaeb41 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Thu, 7 Mar 2024 14:44:58 +0100 Subject: [PATCH 13/17] revert type changes --- src/native/libs/System.Globalization.Native/pal_collation.c | 2 +- .../libs/System.Globalization.Native/pal_localeNumberData.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/native/libs/System.Globalization.Native/pal_collation.c b/src/native/libs/System.Globalization.Native/pal_collation.c index d6e4be28da3a4b..44de265b4a196d 100644 --- a/src/native/libs/System.Globalization.Native/pal_collation.c +++ b/src/native/libs/System.Globalization.Native/pal_collation.c @@ -252,7 +252,7 @@ static void FillIgnoreWidthRules(UChar* completeRules, int32_t* fillIndex, int32 if (isIgnoreCase && (!isIgnoreWidth)) { assert((*fillIndex) + (FullWidthAlphabetRangeLength * 4) <= completeRulesLength); - const UChar UpperCaseToLowerCaseOffset = 0xFF41 - 0xFF21; + const int UpperCaseToLowerCaseOffset = 0xFF41 - 0xFF21; for (UChar ch = 0xFF21; ch <= 0xFF3A; ch++) { diff --git a/src/native/libs/System.Globalization.Native/pal_localeNumberData.c b/src/native/libs/System.Globalization.Native/pal_localeNumberData.c index 1cc0e55d188b17..c0996e373317ee 100644 --- a/src/native/libs/System.Globalization.Native/pal_localeNumberData.c +++ b/src/native/libs/System.Globalization.Native/pal_localeNumberData.c @@ -165,7 +165,7 @@ static int GetNumericPattern(const UNumberFormat* pNumberFormat, int isNegative) { const int INVALID_FORMAT = -1; - const size_t MAX_DOTNET_NUMERIC_PATTERN_LENGTH = 6; // example: "(C n)" plus terminator + const int MAX_DOTNET_NUMERIC_PATTERN_LENGTH = 6; // example: "(C n)" plus terminator UErrorCode ignore = U_ZERO_ERROR; int32_t icuPatternLength = unum_toPattern(pNumberFormat, false, NULL, 0, &ignore) + 1; From a136ec6d5fbf37563ebcc692b32438065efc5bba Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Thu, 7 Mar 2024 17:12:52 +0100 Subject: [PATCH 14/17] Add System.Globalization.Native.def --- .../CMakeLists.txt | 9 +++++ .../System.Globalization.Native.def | 39 +++++++++++++++++++ .../pal_collation.c | 2 +- .../pal_localeNumberData.c | 2 +- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/native/libs/System.Globalization.Native/System.Globalization.Native.def diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 3eb4e68f3ac832..1c13243ef47921 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -149,6 +149,7 @@ if (GEN_SHARED_LIB) add_library(System.Globalization.Native SHARED ${NATIVEGLOBALIZATION_SOURCES} + System.Globalization.Native.def ${VERSION_FILE_RC_PATH} ) else() @@ -166,6 +167,14 @@ if (GEN_SHARED_LIB) ) if(CLR_CMAKE_TARGET_WIN32) + include(GenerateExportHeader) + GENERATE_EXPORT_HEADER( System.Globalization.Native + BASE_NAME System.Globalization.Native + EXPORT_MACRO_NAME System.Globalization.Native_EXPORT + EXPORT_FILE_NAME System.Globalization.Native_Export.h + STATIC_DEFINE System.Globalization.Native_BUILT_AS_STATIC + ) + install (TARGETS System.Globalization.Native DESTINATION .) install (FILES $ DESTINATION .) else() diff --git a/src/native/libs/System.Globalization.Native/System.Globalization.Native.def b/src/native/libs/System.Globalization.Native/System.Globalization.Native.def new file mode 100644 index 00000000000000..3338d4c36994a2 --- /dev/null +++ b/src/native/libs/System.Globalization.Native/System.Globalization.Native.def @@ -0,0 +1,39 @@ +LIBRARY System.Globalization.Native.dll + +EXPORTS + GlobalizationNative_ChangeCase + GlobalizationNative_ChangeCaseInvariant + GlobalizationNative_ChangeCaseTurkish + GlobalizationNative_CloseSortHandle + GlobalizationNative_CompareString + GlobalizationNative_EndsWith + GlobalizationNative_EnumCalendarInfo + GlobalizationNative_GetCalendarInfo + GlobalizationNative_GetCalendars + GlobalizationNative_GetDefaultLocaleName + GlobalizationNative_GetICUVersion + GlobalizationNative_GetJapaneseEraStartDate + GlobalizationNative_GetLatestJapaneseEra + GlobalizationNative_GetLocaleInfoGroupingSizes + GlobalizationNative_GetLocaleInfoInt + GlobalizationNative_GetLocaleInfoString + GlobalizationNative_GetLocaleName + GlobalizationNative_GetLocales + GlobalizationNative_GetLocaleTimeFormat + GlobalizationNative_GetSortHandle + GlobalizationNative_GetSortKey + GlobalizationNative_GetSortVersion + GlobalizationNative_GetTimeZoneDisplayName + GlobalizationNative_IanaIdToWindowsId + GlobalizationNative_IndexOf + GlobalizationNative_InitICUFunctions + GlobalizationNative_IsNormalized + GlobalizationNative_IsPredefinedLocale + GlobalizationNative_LastIndexOf + GlobalizationNative_LoadICU + GlobalizationNative_NormalizeString + GlobalizationNative_StartsWith + GlobalizationNative_WindowsIdToIanaId + GlobalizationNative_ToAscii + GlobalizationNative_ToUnicode + GlobalizationNative_InitOrdinalCasingPage \ No newline at end of file diff --git a/src/native/libs/System.Globalization.Native/pal_collation.c b/src/native/libs/System.Globalization.Native/pal_collation.c index 44de265b4a196d..7f0c5e01f9c98d 100644 --- a/src/native/libs/System.Globalization.Native/pal_collation.c +++ b/src/native/libs/System.Globalization.Native/pal_collation.c @@ -257,7 +257,7 @@ static void FillIgnoreWidthRules(UChar* completeRules, int32_t* fillIndex, int32 for (UChar ch = 0xFF21; ch <= 0xFF3A; ch++) { completeRules[*fillIndex] = '&'; - completeRules[(*fillIndex) + 1] = ch + UpperCaseToLowerCaseOffset; + completeRules[(*fillIndex) + 1] = (UChar)(ch + UpperCaseToLowerCaseOffset); completeRules[(*fillIndex) + 2] = '='; completeRules[(*fillIndex) + 3] = ch; (*fillIndex) += 4; diff --git a/src/native/libs/System.Globalization.Native/pal_localeNumberData.c b/src/native/libs/System.Globalization.Native/pal_localeNumberData.c index c0996e373317ee..1cc0e55d188b17 100644 --- a/src/native/libs/System.Globalization.Native/pal_localeNumberData.c +++ b/src/native/libs/System.Globalization.Native/pal_localeNumberData.c @@ -165,7 +165,7 @@ static int GetNumericPattern(const UNumberFormat* pNumberFormat, int isNegative) { const int INVALID_FORMAT = -1; - const int MAX_DOTNET_NUMERIC_PATTERN_LENGTH = 6; // example: "(C n)" plus terminator + const size_t MAX_DOTNET_NUMERIC_PATTERN_LENGTH = 6; // example: "(C n)" plus terminator UErrorCode ignore = U_ZERO_ERROR; int32_t icuPatternLength = unum_toPattern(pNumberFormat, false, NULL, 0, &ignore) + 1; From 100071403771d5100f58242acebe241c48cfe730 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Mon, 11 Mar 2024 10:15:28 +0100 Subject: [PATCH 15/17] Exclude globalization.native libs when not mono --- eng/liveBuilds.targets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 70a3cac8cbcdd9..5c9f63cf302c9f 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -180,6 +180,9 @@ IsNative="" /> + + - + + - + - + From 9a576856bdb932b8e54c7f98fa87a9494546eb67 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Wed, 13 Mar 2024 14:49:06 +0100 Subject: [PATCH 17/17] revert MSVC_VERSION checks --- src/native/libs/Common/pal_compiler.h | 4 - .../CMakeLists.txt | 2 +- .../pal_icushim_internal.h | 216 +++++++++--------- 3 files changed, 109 insertions(+), 113 deletions(-) diff --git a/src/native/libs/Common/pal_compiler.h b/src/native/libs/Common/pal_compiler.h index 876dd6adad2de7..31d45a0c385be1 100644 --- a/src/native/libs/Common/pal_compiler.h +++ b/src/native/libs/Common/pal_compiler.h @@ -77,10 +77,6 @@ do_abort_unless (bool condition, const char* fmt, ...) #ifdef __cplusplus #define TYPEOF decltype #else -#ifdef _MSC_VER -#define TYPEOF __typeof__ -#else #define TYPEOF __typeof -#endif // _MSVC_VER #endif // __cplusplus #endif // TYPEOF diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index 1c13243ef47921..07080ea9056bb5 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -131,7 +131,7 @@ if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI AND NOT CLR_CMAKE set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} pal_timeZoneInfo.c) endif() -if (MSVC AND MSVC_VERSION LESS 1939) +if (MSVC) # on VS < 17.9 we need to force compile sources as C++ since msvc doesn't support __typeof__ there set_source_files_properties(${NATIVEGLOBALIZATION_SOURCES} PROPERTIES COMPILE_FLAGS "/TP") endif() diff --git a/src/native/libs/System.Globalization.Native/pal_icushim_internal.h b/src/native/libs/System.Globalization.Native/pal_icushim_internal.h index 4dcf73a3a42a74..a7bad69cef3197 100644 --- a/src/native/libs/System.Globalization.Native/pal_icushim_internal.h +++ b/src/native/libs/System.Globalization.Native/pal_icushim_internal.h @@ -232,114 +232,114 @@ FOR_ALL_ICU_FUNCTIONS // Redefine all calls to ICU functions as calls through pointers that are set // to the functions of the selected version of ICU in the initialization. -#define u_charsToUChars(...) (*u_charsToUChars_ptr)(__VA_ARGS__) -#define u_getVersion(...) (*u_getVersion_ptr)(__VA_ARGS__) -#define u_strcmp(...) (*u_strcmp_ptr)(__VA_ARGS__) -#define u_strcpy(...) (*u_strcpy_ptr)(__VA_ARGS__) -#define u_strlen(...) (*u_strlen_ptr)(__VA_ARGS__) -#define u_strncpy(...) (*u_strncpy_ptr)(__VA_ARGS__) -#define u_tolower(...) (*u_tolower_ptr)(__VA_ARGS__) -#define u_toupper(...) (*u_toupper_ptr)(__VA_ARGS__) -#define u_uastrncpy(...) (*u_uastrncpy_ptr)(__VA_ARGS__) -#define ubrk_close(...) (*ubrk_close_ptr)(__VA_ARGS__) -#define ubrk_openRules(...) (*ubrk_openRules_ptr)(__VA_ARGS__) -#define ucal_add(...) (*ucal_add_ptr)(__VA_ARGS__) -#define ucal_close(...) (*ucal_close_ptr)(__VA_ARGS__) -#define ucal_get(...) (*ucal_get_ptr)(__VA_ARGS__) -#define ucal_getAttribute(...) (*ucal_getAttribute_ptr)(__VA_ARGS__) -#define ucal_getKeywordValuesForLocale(...) (*ucal_getKeywordValuesForLocale_ptr)(__VA_ARGS__) -#define ucal_getLimit(...) (*ucal_getLimit_ptr)(__VA_ARGS__) -#define ucal_getNow(...) (*ucal_getNow_ptr)(__VA_ARGS__) -#define ucal_getTimeZoneDisplayName(...) (*ucal_getTimeZoneDisplayName_ptr)(__VA_ARGS__) -#define ucal_getTimeZoneIDForWindowsID(...) (*ucal_getTimeZoneIDForWindowsID_ptr)(__VA_ARGS__) -#define ucal_getWindowsTimeZoneID(...) (*ucal_getWindowsTimeZoneID_ptr)(__VA_ARGS__) -#define ucal_open(...) (*ucal_open_ptr)(__VA_ARGS__) -#define ucal_openTimeZoneIDEnumeration(...) (*ucal_openTimeZoneIDEnumeration_ptr)(__VA_ARGS__) -#define ucal_set(...) (*ucal_set_ptr)(__VA_ARGS__) -#define ucal_setMillis(...) (*ucal_setMillis_ptr)(__VA_ARGS__) -#define ucol_clone(...) (*ucol_clone_ptr)(__VA_ARGS__) -#define ucol_close(...) (*ucol_close_ptr)(__VA_ARGS__) -#define ucol_closeElements(...) (*ucol_closeElements_ptr)(__VA_ARGS__) -#define ucol_getOffset(...) (*ucol_getOffset_ptr)(__VA_ARGS__) -#define ucol_getRules(...) (*ucol_getRules_ptr)(__VA_ARGS__) -#define ucol_getSortKey(...) (*ucol_getSortKey_ptr)(__VA_ARGS__) -#define ucol_getStrength(...) (*ucol_getStrength_ptr)(__VA_ARGS__) -#define ucol_getVersion(...) (*ucol_getVersion_ptr)(__VA_ARGS__) -#define ucol_next(...) (*ucol_next_ptr)(__VA_ARGS__) -#define ucol_previous(...) (*ucol_previous_ptr)(__VA_ARGS__) -#define ucol_open(...) (*ucol_open_ptr)(__VA_ARGS__) -#define ucol_openElements(...) (*ucol_openElements_ptr)(__VA_ARGS__) -#define ucol_openRules(...) (*ucol_openRules_ptr)(__VA_ARGS__) -#define ucol_setAttribute(...) (*ucol_setAttribute_ptr)(__VA_ARGS__) -#define ucol_setMaxVariable(...) (*ucol_setMaxVariable_ptr)(__VA_ARGS__) -#define ucol_strcoll(...) (*ucol_strcoll_ptr)(__VA_ARGS__) -#define ucurr_forLocale(...) (*ucurr_forLocale_ptr)(__VA_ARGS__) -#define ucurr_getName(...) (*ucurr_getName_ptr)(__VA_ARGS__) -#define udat_close(...) (*udat_close_ptr)(__VA_ARGS__) -#define udat_countSymbols(...) (*udat_countSymbols_ptr)(__VA_ARGS__) -#define udat_format(...) (*udat_format_ptr)(__VA_ARGS__) -#define udat_getSymbols(...) (*udat_getSymbols_ptr)(__VA_ARGS__) -#define udat_open(...) (*udat_open_ptr)(__VA_ARGS__) -#define udat_setCalendar(...) (*udat_setCalendar_ptr)(__VA_ARGS__) -#define udat_toPattern(...) (*udat_toPattern_ptr)(__VA_ARGS__) -#define udatpg_close(...) (*udatpg_close_ptr)(__VA_ARGS__) -#define udatpg_getBestPattern(...) (*udatpg_getBestPattern_ptr)(__VA_ARGS__) -#define udatpg_open(...) (*udatpg_open_ptr)(__VA_ARGS__) -#define uenum_close(...) (*uenum_close_ptr)(__VA_ARGS__) -#define uenum_count(...) (*uenum_count_ptr)(__VA_ARGS__) -#define uenum_next(...) (*uenum_next_ptr)(__VA_ARGS__) -#define uidna_close(...) (*uidna_close_ptr)(__VA_ARGS__) -#define uidna_nameToASCII(...) (*uidna_nameToASCII_ptr)(__VA_ARGS__) -#define uidna_nameToUnicode(...) (*uidna_nameToUnicode_ptr)(__VA_ARGS__) -#define uidna_openUTS46(...) (*uidna_openUTS46_ptr)(__VA_ARGS__) -#define uldn_close(...) (*uldn_close_ptr)(__VA_ARGS__) -#define uldn_keyValueDisplayName(...) (*uldn_keyValueDisplayName_ptr)(__VA_ARGS__) -#define uldn_open(...) (*uldn_open_ptr)(__VA_ARGS__) -#define uloc_canonicalize(...) (*uloc_canonicalize_ptr)(__VA_ARGS__) -#define uloc_countAvailable(...) (*uloc_countAvailable_ptr)(__VA_ARGS__) -#define uloc_getAvailable(...) (*uloc_getAvailable_ptr)(__VA_ARGS__) -#define uloc_getBaseName(...) (*uloc_getBaseName_ptr)(__VA_ARGS__) -#define uloc_getCharacterOrientation(...) (*uloc_getCharacterOrientation_ptr)(__VA_ARGS__) -#define uloc_getCountry(...) (*uloc_getCountry_ptr)(__VA_ARGS__) -#define uloc_getDefault(...) (*uloc_getDefault_ptr)(__VA_ARGS__) -#define uloc_getDisplayCountry(...) (*uloc_getDisplayCountry_ptr)(__VA_ARGS__) -#define uloc_getDisplayLanguage(...) (*uloc_getDisplayLanguage_ptr)(__VA_ARGS__) -#define uloc_getDisplayName(...) (*uloc_getDisplayName_ptr)(__VA_ARGS__) -#define uloc_getISO3Country(...) (*uloc_getISO3Country_ptr)(__VA_ARGS__) -#define uloc_getISO3Language(...) (*uloc_getISO3Language_ptr)(__VA_ARGS__) -#define uloc_getKeywordValue(...) (*uloc_getKeywordValue_ptr)(__VA_ARGS__) -#define uloc_getLanguage(...) (*uloc_getLanguage_ptr)(__VA_ARGS__) -#define uloc_getLCID(...) (*uloc_getLCID_ptr)(__VA_ARGS__) -#define uloc_getName(...) (*uloc_getName_ptr)(__VA_ARGS__) -#define uloc_getParent(...) (*uloc_getParent_ptr)(__VA_ARGS__) -#define uloc_setKeywordValue(...) (*uloc_setKeywordValue_ptr)(__VA_ARGS__) -#define ulocdata_getCLDRVersion(...) (*ulocdata_getCLDRVersion_ptr)(__VA_ARGS__) -#define ulocdata_getMeasurementSystem(...) (*ulocdata_getMeasurementSystem_ptr)(__VA_ARGS__) -#define unorm2_getNFCInstance(...) (*unorm2_getNFCInstance_ptr)(__VA_ARGS__) -#define unorm2_getNFDInstance(...) (*unorm2_getNFDInstance_ptr)(__VA_ARGS__) -#define unorm2_getNFKCInstance(...) (*unorm2_getNFKCInstance_ptr)(__VA_ARGS__) -#define unorm2_getNFKDInstance(...) (*unorm2_getNFKDInstance_ptr)(__VA_ARGS__) -#define unorm2_isNormalized(...) (*unorm2_isNormalized_ptr)(__VA_ARGS__) -#define unorm2_normalize(...) (*unorm2_normalize_ptr)(__VA_ARGS__) -#define unum_close(...) (*unum_close_ptr)(__VA_ARGS__) -#define unum_getAttribute(...) (*unum_getAttribute_ptr)(__VA_ARGS__) -#define unum_getSymbol(...) (*unum_getSymbol_ptr)(__VA_ARGS__) -#define unum_open(...) (*unum_open_ptr)(__VA_ARGS__) -#define unum_toPattern(...) (*unum_toPattern_ptr)(__VA_ARGS__) -#define ures_close(...) (*ures_close_ptr)(__VA_ARGS__) -#define ures_getByKey(...) (*ures_getByKey_ptr)(__VA_ARGS__) -#define ures_getSize(...) (*ures_getSize_ptr)(__VA_ARGS__) -#define ures_getStringByIndex(...) (*ures_getStringByIndex_ptr)(__VA_ARGS__) -#define ures_open(...) (*ures_open_ptr)(__VA_ARGS__) -#define usearch_close(...) (*usearch_close_ptr)(__VA_ARGS__) -#define usearch_first(...) (*usearch_first_ptr)(__VA_ARGS__) -#define usearch_getBreakIterator(...) (*usearch_getBreakIterator_ptr)(__VA_ARGS__) -#define usearch_getMatchedLength(...) (*usearch_getMatchedLength_ptr)(__VA_ARGS__) -#define usearch_last(...) (*usearch_last_ptr)(__VA_ARGS__) -#define usearch_openFromCollator(...) (*usearch_openFromCollator_ptr)(__VA_ARGS__) -#define usearch_reset(...) (*usearch_reset_ptr)(__VA_ARGS__) -#define usearch_setPattern(...) (*usearch_setPattern_ptr)(__VA_ARGS__) -#define usearch_setText(...) (*usearch_setText_ptr)(__VA_ARGS__) +#define u_charsToUChars(...) u_charsToUChars_ptr(__VA_ARGS__) +#define u_getVersion(...) u_getVersion_ptr(__VA_ARGS__) +#define u_strcmp(...) u_strcmp_ptr(__VA_ARGS__) +#define u_strcpy(...) u_strcpy_ptr(__VA_ARGS__) +#define u_strlen(...) u_strlen_ptr(__VA_ARGS__) +#define u_strncpy(...) u_strncpy_ptr(__VA_ARGS__) +#define u_tolower(...) u_tolower_ptr(__VA_ARGS__) +#define u_toupper(...) u_toupper_ptr(__VA_ARGS__) +#define u_uastrncpy(...) u_uastrncpy_ptr(__VA_ARGS__) +#define ubrk_close(...) ubrk_close_ptr(__VA_ARGS__) +#define ubrk_openRules(...) ubrk_openRules_ptr(__VA_ARGS__) +#define ucal_add(...) ucal_add_ptr(__VA_ARGS__) +#define ucal_close(...) ucal_close_ptr(__VA_ARGS__) +#define ucal_get(...) ucal_get_ptr(__VA_ARGS__) +#define ucal_getAttribute(...) ucal_getAttribute_ptr(__VA_ARGS__) +#define ucal_getKeywordValuesForLocale(...) ucal_getKeywordValuesForLocale_ptr(__VA_ARGS__) +#define ucal_getLimit(...) ucal_getLimit_ptr(__VA_ARGS__) +#define ucal_getNow(...) ucal_getNow_ptr(__VA_ARGS__) +#define ucal_getTimeZoneDisplayName(...) ucal_getTimeZoneDisplayName_ptr(__VA_ARGS__) +#define ucal_getTimeZoneIDForWindowsID(...) ucal_getTimeZoneIDForWindowsID_ptr(__VA_ARGS__) +#define ucal_getWindowsTimeZoneID(...) ucal_getWindowsTimeZoneID_ptr(__VA_ARGS__) +#define ucal_open(...) ucal_open_ptr(__VA_ARGS__) +#define ucal_openTimeZoneIDEnumeration(...) ucal_openTimeZoneIDEnumeration_ptr(__VA_ARGS__) +#define ucal_set(...) ucal_set_ptr(__VA_ARGS__) +#define ucal_setMillis(...) ucal_setMillis_ptr(__VA_ARGS__) +#define ucol_clone(...) ucol_clone_ptr(__VA_ARGS__) +#define ucol_close(...) ucol_close_ptr(__VA_ARGS__) +#define ucol_closeElements(...) ucol_closeElements_ptr(__VA_ARGS__) +#define ucol_getOffset(...) ucol_getOffset_ptr(__VA_ARGS__) +#define ucol_getRules(...) ucol_getRules_ptr(__VA_ARGS__) +#define ucol_getSortKey(...) ucol_getSortKey_ptr(__VA_ARGS__) +#define ucol_getStrength(...) ucol_getStrength_ptr(__VA_ARGS__) +#define ucol_getVersion(...) ucol_getVersion_ptr(__VA_ARGS__) +#define ucol_next(...) ucol_next_ptr(__VA_ARGS__) +#define ucol_previous(...) ucol_previous_ptr(__VA_ARGS__) +#define ucol_open(...) ucol_open_ptr(__VA_ARGS__) +#define ucol_openElements(...) ucol_openElements_ptr(__VA_ARGS__) +#define ucol_openRules(...) ucol_openRules_ptr(__VA_ARGS__) +#define ucol_setAttribute(...) ucol_setAttribute_ptr(__VA_ARGS__) +#define ucol_setMaxVariable(...) ucol_setMaxVariable_ptr(__VA_ARGS__) +#define ucol_strcoll(...) ucol_strcoll_ptr(__VA_ARGS__) +#define ucurr_forLocale(...) ucurr_forLocale_ptr(__VA_ARGS__) +#define ucurr_getName(...) ucurr_getName_ptr(__VA_ARGS__) +#define udat_close(...) udat_close_ptr(__VA_ARGS__) +#define udat_countSymbols(...) udat_countSymbols_ptr(__VA_ARGS__) +#define udat_format(...) udat_format_ptr(__VA_ARGS__) +#define udat_getSymbols(...) udat_getSymbols_ptr(__VA_ARGS__) +#define udat_open(...) udat_open_ptr(__VA_ARGS__) +#define udat_setCalendar(...) udat_setCalendar_ptr(__VA_ARGS__) +#define udat_toPattern(...) udat_toPattern_ptr(__VA_ARGS__) +#define udatpg_close(...) udatpg_close_ptr(__VA_ARGS__) +#define udatpg_getBestPattern(...) udatpg_getBestPattern_ptr(__VA_ARGS__) +#define udatpg_open(...) udatpg_open_ptr(__VA_ARGS__) +#define uenum_close(...) uenum_close_ptr(__VA_ARGS__) +#define uenum_count(...) uenum_count_ptr(__VA_ARGS__) +#define uenum_next(...) uenum_next_ptr(__VA_ARGS__) +#define uidna_close(...) uidna_close_ptr(__VA_ARGS__) +#define uidna_nameToASCII(...) uidna_nameToASCII_ptr(__VA_ARGS__) +#define uidna_nameToUnicode(...) uidna_nameToUnicode_ptr(__VA_ARGS__) +#define uidna_openUTS46(...) uidna_openUTS46_ptr(__VA_ARGS__) +#define uldn_close(...) uldn_close_ptr(__VA_ARGS__) +#define uldn_keyValueDisplayName(...) uldn_keyValueDisplayName_ptr(__VA_ARGS__) +#define uldn_open(...) uldn_open_ptr(__VA_ARGS__) +#define uloc_canonicalize(...) uloc_canonicalize_ptr(__VA_ARGS__) +#define uloc_countAvailable(...) uloc_countAvailable_ptr(__VA_ARGS__) +#define uloc_getAvailable(...) uloc_getAvailable_ptr(__VA_ARGS__) +#define uloc_getBaseName(...) uloc_getBaseName_ptr(__VA_ARGS__) +#define uloc_getCharacterOrientation(...) uloc_getCharacterOrientation_ptr(__VA_ARGS__) +#define uloc_getCountry(...) uloc_getCountry_ptr(__VA_ARGS__) +#define uloc_getDefault(...) uloc_getDefault_ptr(__VA_ARGS__) +#define uloc_getDisplayCountry(...) uloc_getDisplayCountry_ptr(__VA_ARGS__) +#define uloc_getDisplayLanguage(...) uloc_getDisplayLanguage_ptr(__VA_ARGS__) +#define uloc_getDisplayName(...) uloc_getDisplayName_ptr(__VA_ARGS__) +#define uloc_getISO3Country(...) uloc_getISO3Country_ptr(__VA_ARGS__) +#define uloc_getISO3Language(...) uloc_getISO3Language_ptr(__VA_ARGS__) +#define uloc_getKeywordValue(...) uloc_getKeywordValue_ptr(__VA_ARGS__) +#define uloc_getLanguage(...) uloc_getLanguage_ptr(__VA_ARGS__) +#define uloc_getLCID(...) uloc_getLCID_ptr(__VA_ARGS__) +#define uloc_getName(...) uloc_getName_ptr(__VA_ARGS__) +#define uloc_getParent(...) uloc_getParent_ptr(__VA_ARGS__) +#define uloc_setKeywordValue(...) uloc_setKeywordValue_ptr(__VA_ARGS__) +#define ulocdata_getCLDRVersion(...) ulocdata_getCLDRVersion_ptr(__VA_ARGS__) +#define ulocdata_getMeasurementSystem(...) ulocdata_getMeasurementSystem_ptr(__VA_ARGS__) +#define unorm2_getNFCInstance(...) unorm2_getNFCInstance_ptr(__VA_ARGS__) +#define unorm2_getNFDInstance(...) unorm2_getNFDInstance_ptr(__VA_ARGS__) +#define unorm2_getNFKCInstance(...) unorm2_getNFKCInstance_ptr(__VA_ARGS__) +#define unorm2_getNFKDInstance(...) unorm2_getNFKDInstance_ptr(__VA_ARGS__) +#define unorm2_isNormalized(...) unorm2_isNormalized_ptr(__VA_ARGS__) +#define unorm2_normalize(...) unorm2_normalize_ptr(__VA_ARGS__) +#define unum_close(...) unum_close_ptr(__VA_ARGS__) +#define unum_getAttribute(...) unum_getAttribute_ptr(__VA_ARGS__) +#define unum_getSymbol(...) unum_getSymbol_ptr(__VA_ARGS__) +#define unum_open(...) unum_open_ptr(__VA_ARGS__) +#define unum_toPattern(...) unum_toPattern_ptr(__VA_ARGS__) +#define ures_close(...) ures_close_ptr(__VA_ARGS__) +#define ures_getByKey(...) ures_getByKey_ptr(__VA_ARGS__) +#define ures_getSize(...) ures_getSize_ptr(__VA_ARGS__) +#define ures_getStringByIndex(...) ures_getStringByIndex_ptr(__VA_ARGS__) +#define ures_open(...) ures_open_ptr(__VA_ARGS__) +#define usearch_close(...) usearch_close_ptr(__VA_ARGS__) +#define usearch_first(...) usearch_first_ptr(__VA_ARGS__) +#define usearch_getBreakIterator(...) usearch_getBreakIterator_ptr(__VA_ARGS__) +#define usearch_getMatchedLength(...) usearch_getMatchedLength_ptr(__VA_ARGS__) +#define usearch_last(...) usearch_last_ptr(__VA_ARGS__) +#define usearch_openFromCollator(...) usearch_openFromCollator_ptr(__VA_ARGS__) +#define usearch_reset(...) usearch_reset_ptr(__VA_ARGS__) +#define usearch_setPattern(...) usearch_setPattern_ptr(__VA_ARGS__) +#define usearch_setText(...) usearch_setText_ptr(__VA_ARGS__) #else // !defined(STATIC_ICU)