[tz] windows [MSVC] port progress

random832 at fastmail.us random832 at fastmail.us
Wed Mar 13 17:27:28 UTC 2013

I've made a makefile that can build the library functions (64-bit time_t
only, and haven't done anything yet about MSVCRT functions showing up
through names that tzcode doesn't define such as localtime_s or _ftime
[or the 32-bit names]), and successfully compiled zdump.

I was wondering if anyone had any ideas which approach would be best for
implementing the 32-bit functions. Some background: MSVC defines two
sets of time functions: for 32-bit and 64-bit time_t. But some functions
(e.g. tzset and strftime) are shared between them. (VC2003 defines the
default names as 32-bit, and I don't know if VC6 has the 64-bit
functions at all - making it work on these versions may be somewhat more

I could:
A. Compile separate 32 and 64 bit versions of the library (what happens
if a single program tries to call both?)
B. Compile a single library with 32 and 64 bit versions of functions, a
custom tzset function that calls both (this will pull in most of the
64-bit library when compiling a 32-bit program, but I can avoid pulling
in the 32-bit objects when compiling a 64-bit program)
C. Write wrapper 32-bit functions for 64-bit functions - a bit less
bloated than solution B, but more work.
D. ???

I want to eventually customize tzset anyway, to get the local time zone
from the system settings when TZ is not set (CLDR contains a mapping
from Windows time zone names to tzdata ones). Speaking of which, does
anyone on the list have a non-English version of Windows to test
something with?

More information about the tz mailing list