newlib-cygwin/winsup/cygwin/tzcode
Torbjörn SVENSSON via Newlib 7ed952000c libc/time: Move internal newlib tz-structs into own header
As discussed in GCC bug 97088
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088), parameters in
prototypes of library functions should use reserved names, or no name
at all.

This patch moves the internal struct __tzrule_struct to its own
internal header sys/_tz_structs.h.  This is included from newlib's
time code as well as from Cygwin's localtime wrapper.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-10-15 16:59:51 +02:00
..
README
localtime.c
localtime.c.patch Cygwin: convert localtime_wrapper.c to plain C source 2020-05-26 09:56:57 +02:00
localtime_wrapper.c libc/time: Move internal newlib tz-structs into own header 2020-10-15 16:59:51 +02:00
namespace.h
private.h
tz_posixrules.h
tzfile.h

README

/*
	How the code in this directory is supposed to work...
	2020/05/22 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.  An empty namespace.h suffices for Cygwin.

	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 leading 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.  localtime.c.patched is generated by
	winsup/cygwin/Makefile[.in] operating with localtime.c.patch.

	..mark
*/