Skip to content

Re-enable some functions in __tz.c for use with standalone wasm #22276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions system/lib/libc/musl/src/time/__tz.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ static void getname(char *d, const char **p)
*p += i;
d[i<TZNAME_MAX?i:TZNAME_MAX] = 0;
}
#endif

#define VEC(...) ((const unsigned char[]){__VA_ARGS__})

Expand All @@ -119,6 +120,7 @@ static uint32_t zi_read32(const unsigned char *z)
return (unsigned)z[0]<<24 | z[1]<<16 | z[2]<<8 | z[3];
}

#ifndef __EMSCRIPTEN__
static size_t zi_dotprod(const unsigned char *z, const unsigned char *v, size_t n)
{
size_t y;
Expand Down Expand Up @@ -280,7 +282,6 @@ static void do_tzset()
#endif
}

#ifndef __EMSCRIPTEN__
/* Search zoneinfo rules to find the one that applies to the given time,
* and determine alternate opposite-DST-status rule that may be needed. */

Expand Down Expand Up @@ -440,7 +441,6 @@ void __secs_to_zone(long long t, int local, int *isdst, long *offset, long *oppo
*zonename = __tzname[1];
UNLOCK(lock);
}
#endif

static void __tzset()
{
Expand Down
1 change: 1 addition & 0 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2669,6 +2669,7 @@ def test_pthread_run_on_main_thread(self):
def test_tcgetattr(self):
self.do_runf('termios/test_tcgetattr.c', 'success')

@also_with_standalone_wasm()
def test_time(self):
self.do_core_test('test_time.c')
for tz in ['EST+05EDT', 'UTC+0', 'CET']:
Expand Down
Loading