summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan <jan>2011-04-20 00:01:54 (GMT)
committerjan <jan>2011-04-20 00:01:54 (GMT)
commitb99b0b6866dfddd102e496aa634c4b940ace19d7 (patch)
tree3311ff091a6d8a60128e5ab87c48ea95450f51bd
parenta6a5cd0c448ed7eab1edf7e9812853b9111593d5 (diff)
downloadtcl-b99b0b6866dfddd102e496aa634c4b940ace19d7.zip
tcl-b99b0b6866dfddd102e496aa634c4b940ace19d7.tar.gz
tcl-b99b0b6866dfddd102e496aa634c4b940ace19d7.tar.bz2
fix for [Bug 3288345]: Wrong Tcl_StatBuf used on MinGW. Follow-up: get it right for cygwin and WIN64 as well.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tcl.h8
-rw-r--r--generic/tclIOUtil.c2
-rw-r--r--generic/tclInt.h2
-rw-r--r--win/tclWinFile.c5
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 <nijtmans@users.sf.net>
* 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 <nijtmans@users.sf.net>
+
+ * generic/tcl.h: fix for [Bug 3288345]: Wrong Tcl_StatBuf
used on MinGW.
2011-04-13 Miguel Sofer <msofer@users.sf.net>
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 <winioctl.h>
#include <sys/stat.h>