Skip to content
Merged
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
7 changes: 7 additions & 0 deletions sys/include/ape/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +113 to +118

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addition of timezone_t for POSIX.1-2024 compliance is correct, but the associated function prototypes (tzalloc, tzfree, localtime_rz, and mktime_z) are missing. Since the PR description mentions that parse-datetime.c calls these functions, they should be declared here to avoid implicit declaration warnings or errors. Additionally, mktime_z should be included in the descriptive comment.

Suggested change
/* 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
/* POSIX.1-2024: opaque timezone handle used by tzalloc/tzfree/localtime_rz/mktime_z */
#ifndef __timezone_t_defined
struct tm_zone;
typedef struct tm_zone *timezone_t;
#define __timezone_t_defined 1
timezone_t tzalloc(const char *);
void tzfree(timezone_t);
struct tm *localtime_rz(timezone_t, const time_t *, struct tm *);
time_t mktime_z(timezone_t, struct tm *);
#endif


#include <sys/times.h> /* times */
#include <sys/time.h> /* gettimeofday */

Expand Down
1 change: 1 addition & 0 deletions sys/src/ape/9src/cc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
1 change: 1 addition & 0 deletions sys/src/ape/cmd/patch/mkfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ LIBO=\
gettime.$O\
hash.$O\
parse-datetime.$O\
time_rz.$O\
progname.$O\
quotearg.$O\
tempname.$O\
Expand Down
Loading