[Cygwin PATCH 2/9] tzcode resync: README

Mark Geisert mark@maxrnd.com
Wed May 13 08:23:42 GMT 2020

 winsup/cygwin/tzcode/README | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 winsup/cygwin/tzcode/README

diff --git a/winsup/cygwin/tzcode/README b/winsup/cygwin/tzcode/README
new file mode 100644
index 000000000..a200502ea
--- /dev/null
+++ b/winsup/cygwin/tzcode/README
@@ -0,0 +1,37 @@
+	How the code in this directory is supposed to work...
+	2020/05/13 Mark Geisert <mark@maxrnd.com>
+	localtime.cc is the Cygwin-specific module that is compiled into
+	the Cygwin DLL when the latter is built.  It's just a wrapper that
+	#defines a bunch of stuff then #includes localtime.c.
+	localtime.c, at any point in time, is a reasonably recent version
+	of /src/lib/libc/time/localtime.c from NetBSD.  The same goes for
+	private.h and tzfile.h.  OTOH namespace.h implements something on
+	NetBSD that is not provided on Cygwin, so it's empty here.
+	The idea is that in the future, one just needs to bring over newer
+	versions of localtime.c, private.h, and/or tzfile.h from NetBSD as
+	they become available.
+	With luck, you can drop those files into this directory and they
+	can be immediately used to build a newer Cygwin DLL that has the
+	newer NetBSD functionality.  Without luck, you'll have to tweak the
+	wrapper localtime.cc.  In the worst case, some other strategy will
+	need to be figured out, such as manually pulling out the parts of
+	the NetBSD code Cygwin needs to build a stand-alone localtime.cc.
+	Re tz_posixrules.h: The data elements can be generated from
+	/usr/share/zoneinfo/posixrules in any version of Cygwin's tzdata
+	package.  Instructions are in the comment heading tz_posixrules.h.
+	Addendum:
+	Implementation of the strategy above has uncovered a small number
+	of NetBSD-isms in localtime.c that cannot be worked around with
+	preprocessor tricks.  So there is another file localtime.c.patched
+	that holds just these adjustments for Cygwin, and it's this file
+	that localtime.cc #includes.
+	..mark

More information about the Cygwin-patches mailing list