Tcl Source Code

Check-in [62fbe65d17]
Login

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

Overview
Comment:- eliminate compiler warning when compiling with Visual Studio. - Make sure that _ftime() from msvcrt.dll is used, not ftime() from mingw (which might use 64-bit time_t)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-4-branch
Files: files | file ages | folders
SHA1: 62fbe65d17da7213d4aab3a2dc7c489c86c28d69
User & Date: jan.nijtmans 2013-05-17 15:08:48
Context
2013-05-17
15:12
<sys/stat.h> inclusion is only needed when compiling for Win32, don't bother for other platforms. check-in: a2c3b92118 user: jan.nijtmans tags: core-8-4-branch
15:08
- eliminate compiler warning when compiling with Visual Studio. - Make sure that _ftime() from msvcr... check-in: 62fbe65d17 user: jan.nijtmans tags: core-8-4-branch
07:14
Revert defining _HAVE_32BIT_TIME_T especially for mingw-4.0-rc1: Although it works, it has the side-... check-in: 9480d59af8 user: jan.nijtmans tags: core-8-4-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclBasic.c.

15
16
17
18
19
20
21

22
23
24
25
26
27
28
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#if defined(_WIN32) && !defined(_WIN64)
#   define _USE_32BIT_TIME_T
#endif


#include "tclInt.h"
#include "tclCompile.h"
#ifndef TCL_GENERIC_ONLY
#   include "tclPort.h"
#endif

/*







>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#if defined(_WIN32) && !defined(_WIN64)
#   define _USE_32BIT_TIME_T
#endif

#include <sys/stat.h>
#include "tclInt.h"
#include "tclCompile.h"
#ifndef TCL_GENERIC_ONLY
#   include "tclPort.h"
#endif

/*

Changes to win/tclWinTime.c.

254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
 *----------------------------------------------------------------------
 */

void
Tcl_GetTime(timePtr)
    Tcl_Time *timePtr;		/* Location to store time information. */
{
    struct timeb t;

    int useFtime = 1;		/* Flag == TRUE if we need to fall back
				 * on ftime rather than using the perf
				 * counter */

    /* Initialize static storage on the first trip through. */








|







254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
 *----------------------------------------------------------------------
 */

void
Tcl_GetTime(timePtr)
    Tcl_Time *timePtr;		/* Location to store time information. */
{
    struct _timeb t;

    int useFtime = 1;		/* Flag == TRUE if we need to fall back
				 * on ftime rather than using the perf
				 * counter */

    /* Initialize static storage on the first trip through. */

427
428
429
430
431
432
433
434
435
436
437
438
439
440
441

	LeaveCriticalSection( &timeInfo.cs );
    }

    if ( useFtime ) {
	/* High resolution timer is not available.  Just use ftime */

	ftime(&t);
	timePtr->sec = (long)t.time;
	timePtr->usec = t.millitm * 1000;
    }
}

/*
 *----------------------------------------------------------------------







|







427
428
429
430
431
432
433
434
435
436
437
438
439
440
441

	LeaveCriticalSection( &timeInfo.cs );
    }

    if ( useFtime ) {
	/* High resolution timer is not available.  Just use ftime */

	_ftime(&t);
	timePtr->sec = (long)t.time;
	timePtr->usec = t.millitm * 1000;
    }
}

/*
 *----------------------------------------------------------------------