2 How the code in this directory is supposed to work...
3 2020/05/22 Mark Geisert <mark@maxrnd.com>
5 localtime.cc is the Cygwin-specific module that is compiled into
6 the Cygwin DLL when the latter is built. It's just a wrapper that
7 #defines a bunch of stuff then #includes localtime.c.
9 localtime.c, at any point in time, is a reasonably recent version
10 of /src/lib/libc/time/localtime.c from NetBSD. The same goes for
11 private.h and tzfile.h. An empty namespace.h suffices for Cygwin.
13 The idea is that in the future, one just needs to bring over newer
14 versions of localtime.c, private.h, and/or tzfile.h from NetBSD as
15 they become available.
17 With luck, you can drop those files into this directory and they
18 can be immediately used to build a newer Cygwin DLL that has the
19 newer NetBSD functionality. Without luck, you'll have to tweak the
20 wrapper localtime.cc. In the worst case, some other strategy will
21 need to be figured out, such as manually pulling out the parts of
22 the NetBSD code Cygwin needs to build a stand-alone localtime.cc.
24 Re tz_posixrules.h: The data elements can be generated from
25 /usr/share/zoneinfo/posixrules in any version of Cygwin's tzdata
26 package. Instructions are in the comment leading tz_posixrules.h.
29 Implementation of the strategy above has uncovered a small number
30 of NetBSD-isms in localtime.c that cannot be worked around with
31 preprocessor tricks. So there is another file localtime.c.patched
32 that holds just these adjustments for Cygwin, and it's this file
33 that localtime.cc #includes. localtime.c.patched is generated by
34 winsup/cygwin/Makefile[.in] operating with localtime.c.patch.