iOS Simulator support

This commit is contained in:
Joshua Jackson 2020-05-06 20:07:02 -05:00 committed by Howard Hinnant
parent 9343e31599
commit d784766640

View File

@ -89,6 +89,7 @@
# include "date/ios.h" # include "date/ios.h"
#else #else
# define TARGET_OS_IPHONE 0 # define TARGET_OS_IPHONE 0
# define TARGET_OS_SIMULATOR 0
#endif #endif
#if USE_OS_TZDB #if USE_OS_TZDB
@ -361,7 +362,11 @@ discover_tz_dir()
throw runtime_error("discover_tz_dir failed to find zoneinfo\n"); throw runtime_error("discover_tz_dir failed to find zoneinfo\n");
# else // __APPLE__ # else // __APPLE__
# if TARGET_OS_IPHONE # if TARGET_OS_IPHONE
# if TARGET_OS_SIMULATOR
return "/usr/share/zoneinfo";
# else
return "/var/db/timezone/zoneinfo"; return "/var/db/timezone/zoneinfo";
# endif
# else # else
CONSTDATA auto timezone = "/etc/localtime"; CONSTDATA auto timezone = "/etc/localtime";
if (!(lstat(timezone, &sb) == 0 && S_ISLNK(sb.st_mode) && sb.st_size > 0)) if (!(lstat(timezone, &sb) == 0 && S_ISLNK(sb.st_mode) && sb.st_size > 0))