diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-03-27 12:15:14 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-03-27 12:15:14 (GMT) |
commit | b2cbef50995e481997431490fdb7bc5b0ac220c7 (patch) | |
tree | 0a70e88fac3b104e6ff95b5b7b11a41872249aea /generic | |
parent | 4d9e1c8453091e516efd3919546e5c88e768b53a (diff) | |
parent | e4e0688230bab9b433d43f26f6a9e36b0a32b083 (diff) | |
download | tcl-b2cbef50995e481997431490fdb7bc5b0ac220c7.zip tcl-b2cbef50995e481997431490fdb7bc5b0ac220c7.tar.gz tcl-b2cbef50995e481997431490fdb7bc5b0ac220c7.tar.bz2 |
[Bug 3508771] Wrong Tcl_StatBuf used on MinGW
[Bug 2015723] duplicate inodes from file stat on windows
(but now for cygwin as well)
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.h | 66 | ||||
-rw-r--r-- | generic/tclCmdAH.c | 2 | ||||
-rw-r--r-- | generic/tclFCmd.c | 2 | ||||
-rw-r--r-- | generic/tclOODefineCmds.c | 2 |
4 files changed, 36 insertions, 36 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index cb90096..875a171 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -376,26 +376,13 @@ typedef long LONG; # if defined(__WIN32__) # define TCL_WIDE_INT_TYPE __int64 # ifdef __BORLANDC__ -typedef struct stati64 Tcl_StatBuf; # define TCL_LL_MODIFIER "L" # 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" # endif /* __BORLANDC__ */ # elif defined(__GNUC__) # define TCL_WIDE_INT_TYPE long long # define TCL_LL_MODIFIER "ll" -# 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 is @@ -422,7 +409,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))) @@ -436,25 +422,6 @@ typedef struct stat Tcl_StatBuf; * 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" # endif /* !TCL_LL_MODIFIER */ # define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val))) @@ -462,6 +429,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 /* *---------------------------------------------------------------------------- diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 2308f33..1cbc4d2 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -1544,7 +1544,7 @@ FileAttrIsOwnedCmd( * test for equivalence to the current user. */ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(__CYGWIN__) value = 1; #else value = (geteuid() == buf.st_uid); diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index e95a136..a868fe3 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -520,7 +520,7 @@ CopyRenameOneFile( * 16 bits and we get collisions. See bug #2015723. */ -#ifndef WIN32 +#if !defined(WIN32) && !defined(__CYGWIN__) if ((sourceStatBuf.st_ino != 0) && (targetStatBuf.st_ino != 0)) { if ((sourceStatBuf.st_ino == targetStatBuf.st_ino) && (sourceStatBuf.st_dev == targetStatBuf.st_dev)) { diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index e986326..926966b 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -104,7 +104,7 @@ static const struct DeclaredSlot slots[] = { SLOT("objdefine::filter", ObjFilterGet, ObjFilterSet), SLOT("objdefine::mixin", ObjMixinGet, ObjMixinSet), SLOT("objdefine::variable", ObjVarsGet, ObjVarsSet), - {NULL} + {NULL, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}} }; /* |