Skip to content

Commit ff702ad

Browse files
mojcasffc
authored andcommitted
ICU-21513 check if TARGET_OS_SIMULATOR has been defined
clang 11 throws an error when using undefined variables starting with TARGET_OS_, and TARGET_OS_SIMULATOR is missing in earlier versions of macOS, so the code would not compile without an additional guard. See also ICU-13440.
1 parent b926f52 commit ff702ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

icu4c/source/common/putil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ uprv_pathIsAbsolute(const char *path)
13611361

13621362
/* Backup setting of ICU_DATA_DIR_PREFIX_ENV_VAR
13631363
(needed for some Darwin ICU build environments) */
1364-
#if U_PLATFORM_IS_DARWIN_BASED && TARGET_OS_SIMULATOR
1364+
#if U_PLATFORM_IS_DARWIN_BASED && defined(TARGET_OS_SIMULATOR) && TARGET_OS_SIMULATOR
13651365
# if !defined(ICU_DATA_DIR_PREFIX_ENV_VAR)
13661366
# define ICU_DATA_DIR_PREFIX_ENV_VAR "IPHONE_SIMULATOR_ROOT"
13671367
# endif

0 commit comments

Comments
 (0)