]> Savannah Git Hosting - gnulib.git/commit
mktime, timegm: simplify merge to glibc
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Sep 2018 01:02:48 +0000 (18:02 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Sep 2018 07:22:53 +0000 (00:22 -0700)
commit65d3c969a07369768d028581fdc22fd09e447f2b
tree2e07dfdb78caaca6b7b729a9f13d6495d1ef55e3
parent0e67e4f91c54fc74ae1cf653de544113c01e8a33
mktime, timegm: simplify merge to glibc

Move code around to make a merge to glibc easier to audit.
This should not change behavior.
* lib/mktime.c: Include more standard files unconditionally.
(NEED_MKTIME_INTERNAL, NEED_MKTIME_WINDOWS)
(NEED_MKTIME_WORKING): Give default values to pacify -Wundef,
which glibc uses.  Default NEED_MKTIME_WORKING to DEBUG_MKTIME, to
simplify later conditionals; default the others to zero.  In uses
of these conditionals, explicitly spell out how _LIBC affects
things, so it’s easier to review from a glibc viewpoint.
(my_tzset, __tzset) [!_LIBC]: New function and macro, to better
compartmentalize tzset issues.  Move system-dependent tzsettish
code here from mktime.
(mktime): Move tzsettish code to my_tzset, and move
localtime_offset to within mktime so that it doesn’t
need a separate ifdef.
* lib/mktime-internal.h (__gmtime_r, __localtime_r, __mktime_internal):
Move these macros here from lib/mktime.c and lib/gmtime.c.
ChangeLog
lib/mktime-internal.h
lib/mktime.c
lib/timegm.c