From b99b0b6866dfddd102e496aa634c4b940ace19d7 Mon Sep 17 00:00:00 2001 From: jan Date: Wed, 20 Apr 2011 00:01:54 +0000 Subject: fix for [Bug 3288345]: Wrong Tcl_StatBuf used on MinGW. Follow-up: get it right for cygwin and WIN64 as well. --- ChangeLog | 5 +++++ generic/tcl.h | 8 +++++--- generic/tclIOUtil.c | 2 +- generic/tclInt.h | 2 +- win/tclWinFile.c | 5 +++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 87720e0..b0046a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ 2011-04-18 Jan Nijtmans * generic/tcl.h: fix for [Bug 3288345]: Wrong Tcl_StatBuf + used on MinGW. Follow-up: get it right for cygwin and WIN64 + +2011-04-18 Jan Nijtmans + + * generic/tcl.h: fix for [Bug 3288345]: Wrong Tcl_StatBuf used on MinGW. 2011-04-13 Miguel Sofer diff --git a/generic/tcl.h b/generic/tcl.h index a98b685..264363d 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -372,17 +372,19 @@ typedef long LONG; */ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) -# if defined(__WIN32__) +# if defined(__WIN32__) && !defined(__CYGWIN__) # define TCL_WIDE_INT_TYPE __int64 # ifdef __BORLANDC__ typedef struct stati64 Tcl_StatBuf; # define TCL_LL_MODIFIER "L" # define TCL_LL_MODIFIER_SIZE 1 # else /* __BORLANDC__ */ -# if (defined(_MSC_VER) && (_MSC_VER < 1400)) || !defined(_M_IX86) +# if defined(_WIN64) +typedef struct _stat64 Tcl_StatBuf; +# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) typedef struct _stati64 Tcl_StatBuf; # else -typedef struct _stat64 Tcl_StatBuf; +typedef struct _stat32i64 Tcl_StatBuf; # endif /* _MSC_VER < 1400 */ # define TCL_LL_MODIFIER "I64" # define TCL_LL_MODIFIER_SIZE 3 diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 256cd60..32658a8 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -1910,7 +1910,7 @@ Tcl_FSStat(pathPtr, buf) { Tcl_Filesystem *fsPtr; #ifdef USE_OBSOLETE_FS_HOOKS - struct stat oldStyleStatBuffer; + Tcl_StatBuf oldStyleStatBuffer; int retVal = -1; /* diff --git a/generic/tclInt.h b/generic/tclInt.h index 607dc80..b080fef 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1795,7 +1795,7 @@ typedef struct TclpTime_t_ *CONST TclpTime_t_CONST; *---------------------------------------------------------------- */ -typedef int (TclStatProc_) _ANSI_ARGS_((CONST char *path, struct stat *buf)); +typedef int (TclStatProc_) _ANSI_ARGS_((CONST char *path, Tcl_StatBuf *buf)); typedef int (TclAccessProc_) _ANSI_ARGS_((CONST char *path, int mode)); typedef Tcl_Channel (TclOpenFileChannelProc_) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *fileName, CONST char *modeString, diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 5f88cb2..99dfc2f 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -12,8 +12,9 @@ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -//#define _WIN32_WINNT 0x0500 - +#ifndef _WIN64 +# define _USE_32BIT_TIME_T +#endif #include "tclWinInt.h" #include #include -- cgit v0.12 From 42efbb470ac6bda9d075bc0aee9cf14bcc143fb2 Mon Sep 17 00:00:00 2001 From: jan Date: Wed, 20 Apr 2011 00:02:20 +0000 Subject: (no comment) --- ChangeLog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b0046a4..57f519b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ 2011-04-18 Jan Nijtmans - * generic/tcl.h: fix for [Bug 3288345]: Wrong Tcl_StatBuf - used on MinGW. Follow-up: get it right for cygwin and WIN64 + * generic/tcl.h: fix for [Bug 3288345]: Wrong Tcl_StatBuf + * generic/tclInt.h: used on MinGW. Follow-up: get it right + * generic/tclIOUtil.c: for cygwin and WIN64 as well. + * win/tclWinFile.c: 2011-04-18 Jan Nijtmans -- cgit v0.12 From be4982a04a7e508f516fc9e761a15472c6b3eb8d Mon Sep 17 00:00:00 2001 From: jan Date: Wed, 20 Apr 2011 00:05:00 +0000 Subject: wrong date --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 57f519b..9db76d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2011-04-18 Jan Nijtmans +2011-04-20 Jan Nijtmans * generic/tcl.h: fix for [Bug 3288345]: Wrong Tcl_StatBuf * generic/tclInt.h: used on MinGW. Follow-up: get it right -- cgit v0.12 From e3995f82768b5b9212f3a643a51e50fd3dcbef2b Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 20 Apr 2011 12:54:34 +0000 Subject: Silence unused variable warning --- generic/tclHash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/generic/tclHash.c b/generic/tclHash.c index b5baf22..e7ee344 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -1147,7 +1147,6 @@ RebuildTable(tablePtr) register Tcl_HashEntry **oldChainPtr, **newChainPtr; register Tcl_HashEntry *hPtr; Tcl_HashKeyType *typePtr; - VOID *key; oldSize = tablePtr->numBuckets; oldBuckets = tablePtr->buckets; @@ -1201,7 +1200,7 @@ RebuildTable(tablePtr) hPtr->nextPtr = tablePtr->buckets[index]; tablePtr->buckets[index] = hPtr; #else - key = (VOID *) Tcl_GetHashKey (tablePtr, hPtr); + VOID *key = (VOID *) Tcl_GetHashKey (tablePtr, hPtr); if (typePtr->hashKeyProc) { unsigned int hash; hash = typePtr->hashKeyProc (tablePtr, (VOID *) key); -- cgit v0.12