mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 00:14:07 +08:00
iOS Simulator support
This commit is contained in:
parent
9343e31599
commit
d784766640
@ -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))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user