Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit fd5f28a

Browse files
authored
[release/3.1] Stop leaking atoll in pal and fix unicode header lookup (#28220)
* Stop leaking atoll in pal This fixes the build in newer OSX SDKs. * Port modified version of dotnet/runtime#56829
1 parent 1d48390 commit fd5f28a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/corefx/System.Globalization.Native/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ add_definitions(-DBIT64)
77

88
set(ICU_HOMEBREW_INC_PATH "/usr/local/opt/icu4c/include")
99

10-
find_path(UTYPES_H "unicode/utypes.h" PATHS ${ICU_HOMEBREW_INC_PATH})
11-
if(UTYPES_H STREQUAL UTYPES_H-NOTFOUND)
12-
message(FATAL_ERROR "Cannot find utypes.h, try installing libicu-dev (or the appropriate package for your platform)")
10+
if (CLR_CMAKE_PLATFORM_DARWIN)
11+
execute_process(COMMAND brew --prefix OUTPUT_VARIABLE brew_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
12+
set(ICU_HOMEBREW_INC_PATH "${brew_prefix}/opt/icu4c/include")
13+
endif()
14+
15+
find_path(UCURR_H "unicode/ucurr.h" PATHS ${ICU_HOMEBREW_INC_PATH})
16+
if(UCURR_H STREQUAL UCURR_H-NOTFOUND)
17+
message(FATAL_ERROR "Cannot find ucurr.h, try installing libicu-dev (or the appropriate package for your platform)")
1318
return()
1419
endif()
1520

@@ -44,7 +49,7 @@ set(NATIVEGLOBALIZATION_SOURCES
4449
pal_icushim.c
4550
)
4651

47-
include_directories(${UTYPES_H})
52+
include_directories(${UCURR_H})
4853

4954
_add_library(System.Globalization.Native
5055
SHARED

src/pal/src/include/pal/palinternal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ function_name() to call the system's implementation
206206
#define srand DUMMY_srand
207207
#define atoi DUMMY_atoi
208208
#define atof DUMMY_atof
209+
#define atoll DUMMY_atoll
209210
#define tm PAL_tm
210211
#define size_t DUMMY_size_t
211212
#define time_t PAL_time_t
@@ -413,6 +414,7 @@ function_name() to call the system's implementation
413414
#undef wint_t
414415
#undef atoi
415416
#undef atol
417+
#undef atoll
416418
#undef atof
417419
#undef malloc
418420
#undef realloc

0 commit comments

Comments
 (0)