From 080f8d67798857c827a3947e41fc9e0f3c41fe60 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 23 May 2026 08:01:25 +0000 Subject: [PATCH] ape/cc: accept -p flag; time.h: add timezone_t; patch: add time_rz MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cc.c: -p (profiling flag) now passes through to native compiler like -w/-F/-N/-T instead of printing 'flag ignored'. time.h: add timezone_t as a forward-declared opaque type (POSIX.1-2024). Uses 'struct tm_zone *' with __timezone_t_defined guard so gnulib packages that define the full struct remain compatible. patch/mkfile: add time_rz.$O to LIBO — parse-datetime.c calls tzalloc/tzfree/localtime_rz/mktime_z which are provided by time_rz.c. https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs --- sys/include/ape/time.h | 7 +++++++ sys/src/ape/9src/cc.c | 1 + sys/src/ape/cmd/patch/mkfile | 1 + 3 files changed, 9 insertions(+) diff --git a/sys/include/ape/time.h b/sys/include/ape/time.h index 9c8b4d718..2c8a43619 100644 --- a/sys/include/ape/time.h +++ b/sys/include/ape/time.h @@ -110,6 +110,13 @@ extern long timezone; extern long altzone; extern int daylight; +/* POSIX.1-2024: opaque timezone handle used by tzalloc/tzfree/localtime_rz */ +#ifndef __timezone_t_defined +struct tm_zone; +typedef struct tm_zone *timezone_t; +#define __timezone_t_defined 1 +#endif + #include /* times */ #include /* gettimeofday */ diff --git a/sys/src/ape/9src/cc.c b/sys/src/ape/9src/cc.c index 45256669c..7020d5fdc 100644 --- a/sys/src/ape/9src/cc.c +++ b/sys/src/ape/9src/cc.c @@ -121,6 +121,7 @@ main(int argc, char *argv[]) break; case 'N': case 'T': + case 'p': case 'w': case 'F': append(&cc, smprint("-%c", ARGC())); diff --git a/sys/src/ape/cmd/patch/mkfile b/sys/src/ape/cmd/patch/mkfile index de3de2e89..434ced71c 100644 --- a/sys/src/ape/cmd/patch/mkfile +++ b/sys/src/ape/cmd/patch/mkfile @@ -17,6 +17,7 @@ LIBO=\ gettime.$O\ hash.$O\ parse-datetime.$O\ + time_rz.$O\ progname.$O\ quotearg.$O\ tempname.$O\