summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--generic/tcl.h2
-rw-r--r--generic/tclFCmd.c5
-rw-r--r--generic/tclTest.c5
-rwxr-xr-xwin/configure70
-rw-r--r--win/configure.in20
-rw-r--r--win/tclWinPort.h10
7 files changed, 23 insertions, 100 deletions
diff --git a/ChangeLog b/ChangeLog
index 0af50d9..244e643 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,13 @@
-2012-01-19 Don Porter <dgp@users.sourceforge.net>
+2012-01-21 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tcl.h: [Bug-3474726]: Eliminate detection of struct
+ * generic/tclWinPort.h: _stat32i64, just use _stati64 in combination
+ * generic/tclFCmd.c: with _USE_32BIT_TIME_T, which is the same then.
+ * generic/tclTest.c: Only keep _stat32i64 usage for cygwin, so it
+ * win/configure.in: will not conflict with cygwin's own struct stat.
+ * win/configure:
+
+2012-01-21 Don Porter <dgp@users.sourceforge.net>
* generic/tclCmdMZ.c: [Bug 3475667] Prevent buffer read overflow.
Thanks to "sebres" for the report and fix.
diff --git a/generic/tcl.h b/generic/tcl.h
index 1bc3a89..9fbe378 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -381,7 +381,7 @@ typedef struct stati64 Tcl_StatBuf;
# else /* __BORLANDC__ */
# if defined(_WIN64)
typedef struct __stat64 Tcl_StatBuf;
-# elif (defined(_MSC_VER) && (_MSC_VER < 1400))
+# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T)
typedef struct _stati64 Tcl_StatBuf;
# else
typedef struct _stat32i64 Tcl_StatBuf;
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index 048fa57..0d90094 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -10,6 +10,11 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
+#ifndef _WIN64
+/* See [Bug 2935503]: file mtime sets wrong time */
+# define _USE_32BIT_TIME_T
+#endif
+
#include "tclInt.h"
#include "tclFileSystem.h"
diff --git a/generic/tclTest.c b/generic/tclTest.c
index cd23319..37ec751 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -15,6 +15,11 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
+#ifndef _WIN64
+/* See [Bug 2935503]: file mtime sets wrong time */
+# define _USE_32BIT_TIME_T
+#endif
+
#undef STATIC_BUILD
#ifndef USE_TCL_STUBS
# define USE_TCL_STUBS
diff --git a/win/configure b/win/configure
index 94766ff..0ed0012 100755
--- a/win/configure
+++ b/win/configure
@@ -3483,76 +3483,6 @@ _ACEOF
fi
-# Check to see if struct _stat32i64 exists in mingw's sys/stat.h
-
-echo "$as_me:$LINENO: checking if struct _stat32i64 missing" >&5
-echo $ECHO_N "checking if struct _stat32i64 missing... $ECHO_C" >&6
-if test "${tcl_struct_stat32i64+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-int
-main ()
-{
-
- struct _stat32i64 foo;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- tcl_struct_stat32i64=no
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-tcl_struct_stat32i64=yes
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $tcl_struct_stat32i64" >&5
-echo "${ECHO_T}$tcl_struct_stat32i64" >&6
-if test "$tcl_struct_stat32i64" = "yes" ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_NO_STRUCT_STAT32I64 1
-_ACEOF
-
-fi
-
-
# See if declarations like FINDEX_INFO_LEVELS are
# missing from winbase.h. This is known to be
# a problem with VC++ 5.2.
diff --git a/win/configure.in b/win/configure.in
index a42abdc..1b5f99f 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -225,26 +225,6 @@ if test "$tcl_cv_cast_to_union" = "yes"; then
[Defined when compiler supports casting to union type.])
fi
-# Check to see if struct _stat32i64 exists in mingw's sys/stat.h
-
-AC_CACHE_CHECK(if struct _stat32i64 missing,
- tcl_struct_stat32i64,
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/stat.h>
-],
-[
- struct _stat32i64 foo;
-],
- tcl_struct_stat32i64=no,
- tcl_struct_stat32i64=yes)
-)
-if test "$tcl_struct_stat32i64" = "yes" ; then
- AC_DEFINE(HAVE_NO_STRUCT_STAT32I64, 1,
- [Defined when sys/stat.h is missing struct _stat32i64])
-fi
-
-
# See if declarations like FINDEX_INFO_LEVELS are
# missing from winbase.h. This is known to be
# a problem with VC++ 5.2.
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index 6e9f2ad..16a784c 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -121,9 +121,9 @@
#include <time.h>
/*
- * Not all mingw32 versions have this struct.
+ * cygwin does not have this struct.
*/
-#if !defined(__BORLANDC__) && !defined(_MSC_VER) && !defined(_WIN64) && defined(HAVE_NO_STRUCT_STAT32I64)
+#ifdef __CYGWIN__
struct _stat32i64 {
dev_t st_dev;
ino_t st_ino;
@@ -133,15 +133,9 @@
short st_gid;
dev_t st_rdev;
__int64 st_size;
-#ifdef __CYGWIN__
struct {long tv_sec;} st_atim;
struct {long tv_sec;} st_mtim;
struct {long tv_sec;} st_ctim;
-#else
- long st_atime;
- long st_mtime;
- long st_ctime;
-#endif
};
#endif