On Sun, Oct 05, 2014 at 09:37:39PM +0200, Maurizio Martignano wrote: > > Did you use the define _USE_32BIT_TIME_T yes or not?
> I believe you should use it. I haven't tried using _USE_32BIT_TIME_T yet, but I think using it would be INCORRECT on Windows-64. Tcl 8.5.16 does this in win/tclWinPort.h: #ifndef _WIN64 /* See [Bug 3354324]: file mtime sets wrong time */ # define _USE_32BIT_TIME_T #endif So it does NOT set _USE_32BIT_TIME_T when _WIN64 is defined. I assume _WIN64 is always defined for 64-bit Windows. Relevant discussion appears to be here: http://sourceforge.net/p/tcl/bugs/4845/ http://sourceforge.net/p/tcl/bugs/5115/ http://sourceforge.net/p/mingw/bugs/1973/ It looks to me like the horrible confusion about what should be done is only for ** 32-bit ** Windows systems, especially when trying to support multiple old and new versions of 32-bit Windows. In contrast, 64-bit Windows seems straightforward. And I am on 64-bit Windows now! So I think I should simply NEVER set "_USE_32BIT_TIME_T". Does that sound right? What does Tcl actually do, in practice, on 64-bit Linux and Window? Here's a simple test, which shows that Tcl 8.5.x does indeed use a 64-bit time_t in both those cases, and that the integer values are exactly the same on Windows and Linux, as they should be. That corresponds to my understanding of the code above, that Tcl NEVER sets _USE_32BIT_TIME_T on 64-bit Windows. # On Windows 7 64-bit, running ActiveTcl 8.5: % info patchlevel 8.5.15 % info nameofexecutable C:/P/Tcl85/bin/tclsh85.exe % info sharedlibextension .dll % set in_l [list {1970-01-01 00:00:00 GMT} {2038-12-01 00:00:00 GMT} {9999-12-01 00:00:00 GMT}] {1970-01-01 00:00:00 GMT} {2038-12-01 00:00:00 GMT} {9999-12-01 00:00:00 GMT} % foreach ss $in_l { set tt [clock scan $ss] ; puts "$tt -> [clock format $tt -gmt 1]" } 0 -> Thu Jan 01 00:00:00 GMT 1970 2174774400 -> Wed Dec 01 00:00:00 GMT 2038 253399622400 -> Wed Dec 01 00:00:00 GMT 9999 % exit # On Linux 64-bit, Ubuntu 12.04.3 LTS: $ /usr/bin/tclsh8.5 % info patchlevel 8.5.11 % info nameofexecutable /usr/bin/tclsh8.5 % info sharedlibextension .so % set in_l [list {1970-01-01 00:00:00 GMT} {2038-12-01 00:00:00 GMT} {9999-12-01 00:00:00 GMT}] {1970-01-01 00:00:00 GMT} {2038-12-01 00:00:00 GMT} {9999-12-01 00:00:00 GMT} % foreach ss $in_l { set tt [clock scan $ss] ; puts "$tt -> [clock format $tt -gmt 1]" } 0 -> Thu Jan 01 00:00:00 GMT 1970 2174774400 -> Wed Dec 01 00:00:00 GMT 2038 253399622400 -> Wed Dec 01 00:00:00 GMT 9999 % exit -- Andrew Piskorski <a...@piskorski.com> ------------------------------------------------------------------------------ Slashdot TV. Videos for Nerds. Stuff that Matters. http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk _______________________________________________ naviserver-devel mailing list naviserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/naviserver-devel