Tcl Source Code

Check-in [f062d9ee2c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix [3cf3a939d3]: timezone deprecated in vc2017
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA3-256: f062d9ee2c34dcc2e22373adab10f58296cf67361017e65f9e1cb842eece8e35
User & Date: jan.nijtmans 2018-12-30 22:44:22.285
References
2019-02-01
18:32 Ticket [3cf3a939d3] timezone deprecated in vc2017 status still Open with 3 other changes artifact: bcb55f2326 user: sebres
Context
2019-01-03
20:47
Fix conflict with timezone() function in some MSVC versions check-in: 9ca59559ba user: jan.nijtmans tags: core-8-5-branch
2018-12-30
22:47
Fix [3cf3a939d3]: timezone deprecated in vc2017. Also remo... check-in: 60046a53c0 user: jan.nijtmans tags: core-8-6-branch
22:44
Fix [3cf3a939d3]: timezone deprecated in vc2017 check-in: f062d9ee2c user: jan.nijtmans tags: core-8-5-branch
2018-12-20
08:06
(cherry-pick) relax the timings of 2 tests, which incidentally fail on Travis CI. Also backport a fe... check-in: bdc8413143 user: jan.nijtmans tags: core-8-5-branch
Changes
Unified Diff Ignore Whitespace Patch
Changes to win/tclWinTime.c.
643
644
645
646
647
648
649




650
651
652
653
654
655
656
    CONST time_t *t,
    int useGMT)
{
    struct tm *tmPtr;
    time_t time;

    if (!useGMT) {




	tzset();

	/*
	 * If we are in the valid range, let the C run-time library handle it.
	 * Otherwise we need to fake it. Note that this algorithm ignores
	 * daylight savings time before the epoch.
	 */







>
>
>
>







643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
    CONST time_t *t,
    int useGMT)
{
    struct tm *tmPtr;
    time_t time;

    if (!useGMT) {
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
	long timezone = 0;
#endif

	tzset();

	/*
	 * If we are in the valid range, let the C run-time library handle it.
	 * Otherwise we need to fake it. Note that this algorithm ignores
	 * daylight savings time before the epoch.
	 */
671
672
673
674
675
676
677




678
679
680
681
682
683
684
#else
#define LOCALTIME_VALIDITY_BOUNDARY	0
#endif

	if (*t >= LOCALTIME_VALIDITY_BOUNDARY) {
	    return TclpLocaltime(t);
	}





	time = *t - timezone;

	/*
	 * If we aren't near to overflowing the long, just add the bias and
	 * use the normal calculation. Otherwise we will need to adjust the
	 * result at the end.







>
>
>
>







675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
#else
#define LOCALTIME_VALIDITY_BOUNDARY	0
#endif

	if (*t >= LOCALTIME_VALIDITY_BOUNDARY) {
	    return TclpLocaltime(t);
	}

#if defined(_MSC_VER) && (_MSC_VER >= 1900)
	_get_timezone(&timezone);
#endif

	time = *t - timezone;

	/*
	 * If we aren't near to overflowing the long, just add the bias and
	 * use the normal calculation. Otherwise we will need to adjust the
	 * result at the end.