mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-25 06:42:27 +00:00
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:
parent
d5ebb1fa5b
commit
b0df6c1fce
627 changed files with 3052 additions and 2077 deletions
6
third_party/python/BUILD.mk
vendored
6
third_party/python/BUILD.mk
vendored
|
@ -470,11 +470,11 @@ THIRD_PARTY_PYTHON_STAGE1_A_DIRECTDEPS = \
|
|||
LIBC_SYSV \
|
||||
LIBC_SYSV_CALLS \
|
||||
LIBC_THREAD \
|
||||
LIBC_TIME \
|
||||
LIBC_TINYMATH \
|
||||
LIBC_X \
|
||||
THIRD_PARTY_DLMALLOC \
|
||||
THIRD_PARTY_GETOPT \
|
||||
THIRD_PARTY_TZ \
|
||||
THIRD_PARTY_XED \
|
||||
TOOL_BUILD_LIB \
|
||||
TOOL_ARGS
|
||||
|
@ -1180,7 +1180,6 @@ THIRD_PARTY_PYTHON_STAGE2_A_DIRECTDEPS = \
|
|||
LIBC_STR \
|
||||
LIBC_SYSV \
|
||||
LIBC_SYSV_CALLS \
|
||||
LIBC_TIME \
|
||||
LIBC_TINYMATH \
|
||||
LIBC_X \
|
||||
NET_HTTP \
|
||||
|
@ -1189,9 +1188,10 @@ THIRD_PARTY_PYTHON_STAGE2_A_DIRECTDEPS = \
|
|||
THIRD_PARTY_GDTOA \
|
||||
THIRD_PARTY_LINENOISE \
|
||||
THIRD_PARTY_MUSL \
|
||||
THIRD_PARTY_PYTHON_STAGE1 \
|
||||
THIRD_PARTY_MBEDTLS \
|
||||
THIRD_PARTY_PYTHON_STAGE1 \
|
||||
THIRD_PARTY_SQLITE3 \
|
||||
THIRD_PARTY_TZ \
|
||||
THIRD_PARTY_ZLIB \
|
||||
THIRD_PARTY_XED \
|
||||
TOOL_ARGS
|
||||
|
|
2
third_party/python/Include/pytime.h
vendored
2
third_party/python/Include/pytime.h
vendored
|
@ -4,7 +4,7 @@
|
|||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Include/object.h"
|
||||
#include "third_party/python/pyconfig.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
|
|
@ -1985,7 +1985,7 @@ class TestStdev(VarianceStdevMixin, NumericTestCase):
|
|||
|
||||
# === Run tests ===
|
||||
|
||||
def load_tests(loader, tests, ignore):
|
||||
def load_tests(loader, tests, ignore=None):
|
||||
"""Used for doctest/unittest integration."""
|
||||
tests.addTests(doctest.DocTestSuite())
|
||||
return tests
|
||||
|
|
4
third_party/python/Lib/test/test_time.py
vendored
4
third_party/python/Lib/test/test_time.py
vendored
|
@ -300,8 +300,8 @@ class TimeTestCase(unittest.TestCase):
|
|||
# utc='UTC+0'
|
||||
|
||||
utc = 'UTC'
|
||||
eastern = 'New_York'
|
||||
victoria = 'Melbourne'
|
||||
eastern = 'America/New_York'
|
||||
victoria = 'Australia/Melbourne'
|
||||
|
||||
org_TZ = environ.get('TZ',None)
|
||||
try:
|
||||
|
|
2
third_party/python/Modules/_datetimemodule.c
vendored
2
third_party/python/Modules/_datetimemodule.c
vendored
|
@ -7,7 +7,7 @@
|
|||
#include "libc/assert.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/descrobject.h"
|
||||
|
|
3
third_party/python/Modules/_lsprof.c
vendored
3
third_party/python/Modules/_lsprof.c
vendored
|
@ -5,8 +5,7 @@
|
|||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/ceval.h"
|
||||
#include "third_party/python/Include/dictobject.h"
|
||||
|
|
2
third_party/python/Modules/_testcapimodule.c
vendored
2
third_party/python/Modules/_testcapimodule.c
vendored
|
@ -13,7 +13,7 @@
|
|||
#include "libc/math.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/bytearrayobject.h"
|
||||
|
|
3
third_party/python/Modules/_threadmodule.c
vendored
3
third_party/python/Modules/_threadmodule.c
vendored
|
@ -58,8 +58,7 @@
|
|||
#include "libc/sysv/consts/w.h"
|
||||
#include "libc/sysv/consts/waitid.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/time/struct/utimbuf.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
#include "third_party/musl/passwd.h"
|
||||
|
|
2
third_party/python/Modules/expat/xmlparse.c
vendored
2
third_party/python/Modules/expat/xmlparse.c
vendored
|
@ -11,7 +11,7 @@
|
|||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/grnd.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Modules/expat/expat.h"
|
||||
#include "third_party/python/Modules/expat/expat_config.h"
|
||||
/* f2d0ab6d1d4422a08cf1cf3bbdfba96b49dea42fb5ff4615e03a2a25c306e769 (2.2.8+)
|
||||
|
|
4
third_party/python/Modules/posixmodule.c
vendored
4
third_party/python/Modules/posixmodule.c
vendored
|
@ -61,8 +61,8 @@
|
|||
#include "libc/sysv/consts/w.h"
|
||||
#include "libc/sysv/consts/waitid.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/time/struct/utimbuf.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/utime.h"
|
||||
#include "libc/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/musl/lockf.h"
|
||||
#include "third_party/musl/passwd.h"
|
||||
|
|
2
third_party/python/Modules/signalmodule.c
vendored
2
third_party/python/Modules/signalmodule.c
vendored
|
@ -13,7 +13,7 @@
|
|||
#include "libc/sysv/consts/itimer.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/ceval.h"
|
||||
#include "third_party/python/Include/dictobject.h"
|
||||
|
|
3
third_party/python/Modules/timemodule.c
vendored
3
third_party/python/Modules/timemodule.c
vendored
|
@ -17,8 +17,7 @@
|
|||
#include "libc/sock/select.h"
|
||||
#include "libc/sysv/consts/clock.h"
|
||||
#include "libc/sysv/consts/rusage.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/ceval.h"
|
||||
|
|
2
third_party/python/Modules/xxsubtype.c
vendored
2
third_party/python/Modules/xxsubtype.c
vendored
|
@ -5,7 +5,7 @@
|
|||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Include/descrobject.h"
|
||||
#include "third_party/python/Include/dictobject.h"
|
||||
#include "third_party/python/Include/floatobject.h"
|
||||
|
|
3
third_party/python/Modules/zipimport.c
vendored
3
third_party/python/Modules/zipimport.c
vendored
|
@ -7,8 +7,7 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/bytesobject.h"
|
||||
|
|
2
third_party/python/Python/condvar.h
vendored
2
third_party/python/Python/condvar.h
vendored
|
@ -1,6 +1,6 @@
|
|||
#ifndef _CONDVAR_H_
|
||||
#define _CONDVAR_H_
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
|
||||
/*
|
||||
* Portable condition variable support for windows and pthreads.
|
||||
|
|
2
third_party/python/Python/pytime.c
vendored
2
third_party/python/Python/pytime.c
vendored
|
@ -9,7 +9,7 @@
|
|||
#include "libc/math.h"
|
||||
#include "libc/nt/synchronization.h"
|
||||
#include "libc/sysv/consts/clock.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "third_party/python/Include/floatobject.h"
|
||||
#include "third_party/python/Include/longobject.h"
|
||||
#include "third_party/python/Include/object.h"
|
||||
|
|
2
third_party/python/pyobj.c
vendored
2
third_party/python/pyobj.c
vendored
|
@ -33,7 +33,7 @@
|
|||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/sysv/consts/clock.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "libc/zip.internal.h"
|
||||
#include "third_party/getopt/getopt.internal.h"
|
||||
|
|
2
third_party/python/runpythonmodule.c
vendored
2
third_party/python/runpythonmodule.c
vendored
|
@ -27,7 +27,7 @@
|
|||
#include "libc/sysv/consts/fileno.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "libc/x/xasprintf.h"
|
||||
#include "third_party/linenoise/linenoise.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue