summaryrefslogtreecommitdiffstats
path: root/generic/tcl.h
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-27 11:20:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-27 11:20:55 (GMT)
commitb38ff7bf98f44f9eaa8dd4715cf3dca8decbe24d (patch)
tree6929ad8d04393f5896cf880f00b93ac8f43551b2 /generic/tcl.h
parent077e22ea3fdf94b4658ffa043b411e2caab05bf4 (diff)
downloadtcl-b38ff7bf98f44f9eaa8dd4715cf3dca8decbe24d.zip
tcl-b38ff7bf98f44f9eaa8dd4715cf3dca8decbe24d.tar.gz
tcl-b38ff7bf98f44f9eaa8dd4715cf3dca8decbe24d.tar.bz2
[Bug 3508771] Wrong Tcl_StatBuf used on MinGW
[Bug 2015723] duplicate inodes from file stat on windows
Diffstat (limited to 'generic/tcl.h')
-rw-r--r--generic/tcl.h66
1 files changed, 33 insertions, 33 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index e794032..3c6ef5e 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -376,17 +376,9 @@ typedef long LONG;
# if defined(__WIN32__)
# 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(_WIN64)
-typedef struct __stat64 Tcl_StatBuf;
-# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
-typedef struct _stati64 Tcl_StatBuf;
-# else
-typedef struct _stat32i64 Tcl_StatBuf;
-# endif /* _MSC_VER < 1400 */
# define TCL_LL_MODIFIER "I64"
# define TCL_LL_MODIFIER_SIZE 3
# endif /* __BORLANDC__ */
@@ -394,11 +386,6 @@ typedef struct _stat32i64 Tcl_StatBuf;
# define TCL_WIDE_INT_TYPE long long
# define TCL_LL_MODIFIER "ll"
# define TCL_LL_MODIFIER_SIZE 2
-# if defined(__WIN32__)
-typedef struct _stat32i64 Tcl_StatBuf;
-# else
-typedef struct stat Tcl_StatBuf;
-# endif
# else /* ! __WIN32__ && ! __GNUC__ */
/*
* Don't know what platform it is and configure hasn't discovered what
@@ -425,7 +412,6 @@ typedef TCL_WIDE_INT_TYPE Tcl_WideInt;
typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
#ifdef TCL_WIDE_INT_IS_LONG
-typedef struct stat Tcl_StatBuf;
# define Tcl_WideAsLong(val) ((long)(val))
# define Tcl_LongAsWide(val) ((long)(val))
# define Tcl_WideAsDouble(val) ((double)((long)(val)))
@@ -440,25 +426,6 @@ typedef struct stat Tcl_StatBuf;
* Windows or some other strange platform.
*/
# ifndef TCL_LL_MODIFIER
-# ifdef __CYGWIN__
-typedef struct _stat32i64 {
- dev_t st_dev;
- ino_t st_ino;
- unsigned short st_mode;
- short st_nlink;
- short st_uid;
- short st_gid;
- dev_t st_rdev;
- long long st_size;
- struct {long tv_sec;} st_atim;
- struct {long tv_sec;} st_mtim;
- struct {long tv_sec;} st_ctim;
-} Tcl_StatBuf;
-# elif defined(HAVE_STRUCT_STAT64)
-typedef struct stat64 Tcl_StatBuf;
-# else
-typedef struct stat Tcl_StatBuf;
-# endif /* HAVE_STRUCT_STAT64 */
# define TCL_LL_MODIFIER "ll"
# define TCL_LL_MODIFIER_SIZE 2
# endif /* !TCL_LL_MODIFIER */
@@ -467,6 +434,39 @@ typedef struct stat Tcl_StatBuf;
# define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))
# define Tcl_DoubleAsWide(val) ((Tcl_WideInt)((double)(val)))
#endif /* TCL_WIDE_INT_IS_LONG */
+
+#if defined(__WIN32__)
+# ifdef __BORLANDC__
+ typedef struct stati64 Tcl_StatBuf;
+# elif defined(_WIN64)
+ typedef struct __stat64 Tcl_StatBuf;
+# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
+ typedef struct _stati64 Tcl_StatBuf;
+# else
+ typedef struct _stat32i64 Tcl_StatBuf;
+# endif /* _MSC_VER < 1400 */
+#elif defined(__CYGWIN__)
+ typedef struct _stat32i64 {
+ dev_t st_dev;
+ unsigned short st_ino;
+ unsigned short st_mode;
+ short st_nlink;
+ short st_uid;
+ short st_gid;
+ /* Here is a 2-byte gap */
+ dev_t st_rdev;
+ /* Here is a 4-byte gap */
+ long long st_size;
+ struct {long tv_sec;} st_atim;
+ struct {long tv_sec;} st_mtim;
+ struct {long tv_sec;} st_ctim;
+ /* Here is a 4-byte gap */
+ } Tcl_StatBuf;
+#elif defined(HAVE_STRUCT_STAT64)
+ typedef struct stat64 Tcl_StatBuf;
+#else
+ typedef struct stat Tcl_StatBuf;
+#endif
/*