Skip to content

Commit

Permalink
ICU-21513 check if TARGET_OS_SIMULATOR has been defined
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mojca authored and sffc committed Apr 7, 2021
1 parent b926f52 commit ff702ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion icu4c/source/common/putil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ uprv_pathIsAbsolute(const char *path)

/* Backup setting of ICU_DATA_DIR_PREFIX_ENV_VAR
(needed for some Darwin ICU build environments) */
#if U_PLATFORM_IS_DARWIN_BASED && TARGET_OS_SIMULATOR
#if U_PLATFORM_IS_DARWIN_BASED && defined(TARGET_OS_SIMULATOR) && TARGET_OS_SIMULATOR
# if !defined(ICU_DATA_DIR_PREFIX_ENV_VAR)
# define ICU_DATA_DIR_PREFIX_ENV_VAR "IPHONE_SIMULATOR_ROOT"
# endif
Expand Down

0 comments on commit ff702ad

Please sign in to comment.