Implement proper time zone support

Cosmopolitan now supports 104 time zones. They're embedded inside any
binary that links the localtime() function. Doing so adds about 100kb
to the binary size. This change also gets time zones working properly
on Windows for the first time. It's not needed to have /etc/localtime
exist on Windows, since we can get this information from WIN32. We're
also now updated to the latest version of Paul Eggert's TZ library.
This commit is contained in:
Justine Tunney 2024-05-04 23:05:36 -07:00
parent d5ebb1fa5b
commit b0df6c1fce
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
627 changed files with 3052 additions and 2077 deletions

View file

@ -90,9 +90,9 @@ THIRD_PARTY_ZIP_DIRECTDEPS = \
LIBC_PROC \
LIBC_STR \
LIBC_SYSV \
LIBC_TIME \
LIBC_X \
THIRD_PARTY_BZIP2 \
THIRD_PARTY_TZ \
THIRD_PARTY_ZLIB
THIRD_PARTY_ZIP_DEPS := \

View file

@ -80,8 +80,7 @@
#include "libc/sysv/consts/clock.h"
#include "libc/sysv/consts/sched.h"
#include "libc/sysv/consts/timer.h"
#include "libc/time/struct/tm.h"
#include "libc/time/time.h" /* time() function supplies first part of crypt seed */
#include "libc/time.h" /* time() function supplies first part of crypt seed */
/* "last resort" source for second part of crypt seed pattern */
# ifndef ZCR_SEED2
# define ZCR_SEED2 (unsigned)3141592654L /* use PI as default pattern */

View file

@ -30,8 +30,7 @@
#include "libc/sysv/consts/clock.h"
#include "libc/sysv/consts/sched.h"
#include "libc/sysv/consts/timer.h"
#include "libc/time/struct/tm.h"
#include "libc/time/time.h"
#include "libc/time.h"
#ifdef NO_MKTIME
time_t mktime OF((struct tm *));

View file

@ -41,7 +41,7 @@
#include "libc/calls/weirdtypes.h"
#include "libc/sysv/consts/s.h"
#include "libc/sysv/consts/utime.h"
#include "libc/time/time.h"
#include "libc/time.h"
/* printf format size prefix for zoff_t values */
#ifdef LARGE_FILE_SUPPORT

View file

@ -258,7 +258,7 @@
#include "libc/sysv/consts/fileno.h"
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/ok.h"
#include "libc/time/time.h"
#include "libc/time.h"
#include "third_party/musl/crypt.h"
#include "third_party/musl/lockf.h" /* usually defines _POSIX_VERSION */
#endif /* !NO_UNISTD_H */
@ -382,7 +382,7 @@ IZ_IMP char *mktemp();
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
#include "libc/str/unicode.h"
#include "libc/time/time.h"
#include "libc/time.h"
#include "libc/calls/calls.h"
#include "libc/fmt/conv.h"
#include "libc/str/str.h"

View file

@ -19,8 +19,7 @@
#include "libc/sysv/consts/clock.h"
#include "libc/sysv/consts/sched.h"
#include "libc/sysv/consts/timer.h"
#include "libc/time/struct/tm.h"
#include "libc/time/time.h"
#include "libc/time.h"
#if defined(MINIX) || defined(__mpexl)
# ifdef S_IWRITE
@ -60,8 +59,7 @@
/* Library functions not in (most) header files */
#ifdef _POSIX_VERSION
#include "libc/time/struct/utimbuf.h"
#include "libc/time/time.h"
#include "libc/utime.h"
#else
int utime OF((char *, time_t *));
#endif

View file

@ -20,8 +20,7 @@
#include "libc/sysv/consts/clock.h"
#include "libc/sysv/consts/sched.h"
#include "libc/sysv/consts/timer.h"
#include "libc/time/struct/tm.h"
#include "libc/time/time.h" /* for tzset() declaration */
#include "libc/time.h" /* for tzset() declaration */
#if defined(WIN32) || defined(WINDLL)
# define WIN32_LEAN_AND_MEAN
#include "libc/nt/accounting.h"