summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-05-17 14:02:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-05-17 14:02:37 (GMT)
commite810c9099a64e6af0d3aad22f673de6edcb68cd7 (patch)
tree12f52eab3efaa66365d83ac1ebca1d9a82552186
parenta88536e249e7c0d450e0719ee852a1fbb4a748fa (diff)
parent7ba4645e08b43df72712f9266336efe3d9badfba (diff)
downloadtcl-e810c9099a64e6af0d3aad22f673de6edcb68cd7.zip
tcl-e810c9099a64e6af0d3aad22f673de6edcb68cd7.tar.gz
tcl-e810c9099a64e6af0d3aad22f673de6edcb68cd7.tar.bz2
rebase
-rw-r--r--generic/tcl.h24
-rw-r--r--generic/tclBasic.c8
-rwxr-xr-xunix/configure4
-rw-r--r--unix/tcl.m46
-rw-r--r--unix/tclConfig.h.in4
-rw-r--r--unix/tclUnixFCmd.c2
-rw-r--r--unix/tclUnixPort.h8
-rw-r--r--win/tclWinFile.c14
-rw-r--r--win/tclWinPort.h9
9 files changed, 33 insertions, 46 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 6f597bd..0db4131 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -240,7 +240,6 @@ typedef void *ClientData;
# undef TCL_WIDE_INT_IS_LONG
# undef TCL_CFG_DO64BIT
# endif /* __LP64__ */
-# undef HAVE_STRUCT_STAT64
#endif /* __APPLE__ */
/*
@@ -323,15 +322,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
#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 */
+ typedef struct __stat64 Tcl_StatBuf;
#elif defined(__CYGWIN__)
typedef struct {
dev_t st_dev;
@@ -344,15 +335,14 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt;
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 */
+ struct {long long tv_sec;} st_atim;
+ struct {long long tv_sec;} st_mtim;
+ struct {long long tv_sec;} st_ctim;
} Tcl_StatBuf;
-#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
- typedef struct stat64 Tcl_StatBuf;
-#else
+#elif defined(HAVE_NO_STRUCT_STAT64)
typedef struct stat Tcl_StatBuf;
+#else
+ typedef struct stat64 Tcl_StatBuf;
#endif
/*
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index e14efa5..8ba1a3b 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -470,13 +470,13 @@ Tcl_CreateInterp(void)
}
#if defined(_WIN32) && !defined(_WIN64)
- if (sizeof(time_t) != 4) {
+ if (sizeof(time_t) != 8) {
/*NOTREACHED*/
- Tcl_Panic("sys/time.h is not compatible with MSVC");
+ Tcl_Panic("sys/time.h is not compatible with VS2005+");
}
- if (sizeof(Tcl_StatBuf) != 48) {
+ if (sizeof(Tcl_StatBuf) != 56) {
/*NOTREACHED*/
- Tcl_Panic("sys/stat.h is not compatible with MSVC");
+ Tcl_Panic("sys/stat.h is not compatible with VS2005+");
}
#endif
diff --git a/unix/configure b/unix/configure
index c8335ae..e3279eb 100755
--- a/unix/configure
+++ b/unix/configure
@@ -9959,10 +9959,10 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5
echo "${ECHO_T}$tcl_cv_struct_stat64" >&6
- if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+ if test "x${tcl_cv_struct_stat64}" != "xyes" ; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_STAT64 1
+#define HAVE_NO_STRUCT_STAT64 1
_ACEOF
fi
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index af3150c..cb6289b 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -2646,7 +2646,7 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
# TCL_WIDE_INT_IS_LONG
# TCL_WIDE_INT_TYPE
# HAVE_STRUCT_DIRENT64
-# HAVE_STRUCT_STAT64
+# HAVE_NO_STRUCT_STAT64
# HAVE_TYPE_OFF64_T
#
#--------------------------------------------------------------------
@@ -2685,8 +2685,8 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
],
tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
- if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
- AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
+ if test "x${tcl_cv_struct_stat64}" != "xyes" ; then
+ AC_DEFINE(HAVE_NO_STRUCT_STAT64, 1, [Is 'struct stat64' missing from <sys/stat.h>?])
fi
AC_CHECK_FUNCS(open64 lseek64)
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index 839c2ab..f31bbde 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -208,8 +208,8 @@
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
#undef HAVE_STRUCT_SOCKADDR_STORAGE
-/* Is 'struct stat64' in <sys/stat.h>? */
-#undef HAVE_STRUCT_STAT64
+/* Is 'struct stat64' missing from <sys/stat.h>? */
+#undef HAVE_NO_STRUCT_STAT64
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 3c6d3f9..97a25dc 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -242,7 +242,7 @@ MODULE_SCOPE long tclMacOSXDarwinRelease;
#endif /* NO_REALPATH */
#ifdef HAVE_FTS
-#if defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
+#if !defined(HAVE_NO_STRUCT_STAT64)
/* fts doesn't do stat64 */
# define noFtsStat 1
#elif defined(__APPLE__) && defined(__LP64__) && \
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index fde1909..ce74fea 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -106,12 +106,12 @@ typedef off_t Tcl_SeekOffset;
# define timezone _timezone
extern int TclOSstat(const char *name, void *statBuf);
extern int TclOSlstat(const char *name, void *statBuf);
-#elif defined(HAVE_STRUCT_STAT64) && !defined(__APPLE__)
-# define TclOSstat stat64
-# define TclOSlstat lstat64
-#else
+#elif defined(HAVE_NO_STRUCT_STAT64)
# define TclOSstat stat
# define TclOSlstat lstat
+#else
+# define TclOSstat stat64
+# define TclOSlstat lstat64
#endif
/*
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 8e517d1..0deeb70 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -144,8 +144,8 @@ typedef struct {
* Other typedefs required by this code.
*/
-static time_t ToCTime(FILETIME fileTime);
-static void FromCTime(time_t posixTime, FILETIME *fileTime);
+static __time64_t ToCTime(FILETIME fileTime);
+static void FromCTime(__time64_t posixTime, FILETIME *fileTime);
/*
* Declarations for local functions defined in this file:
@@ -2152,7 +2152,7 @@ NativeStatMode(
*
* ToCTime --
*
- * Converts a Windows FILETIME to a time_t in UTC.
+ * Converts a Windows FILETIME to a __time64_t in UTC.
*
* Results:
* Returns the count of seconds from the Posix epoch.
@@ -2160,7 +2160,7 @@ NativeStatMode(
*------------------------------------------------------------------------
*/
-static time_t
+static __time64_t
ToCTime(
FILETIME fileTime) /* UTC time */
{
@@ -2169,7 +2169,7 @@ ToCTime(
convertedTime.LowPart = fileTime.dwLowDateTime;
convertedTime.HighPart = (LONG) fileTime.dwHighDateTime;
- return (time_t) ((convertedTime.QuadPart -
+ return (__time64_t) ((convertedTime.QuadPart -
(Tcl_WideInt) POSIX_EPOCH_AS_FILETIME) / (Tcl_WideInt) 10000000);
}
@@ -2178,7 +2178,7 @@ ToCTime(
*
* FromCTime --
*
- * Converts a time_t to a Windows FILETIME
+ * Converts a __time64_t to a Windows FILETIME
*
* Results:
* Returns the count of 100-ns ticks seconds from the Windows epoch.
@@ -2188,7 +2188,7 @@ ToCTime(
static void
FromCTime(
- time_t posixTime,
+ __time64_t posixTime,
FILETIME *fileTime) /* UTC Time */
{
LARGE_INTEGER convertedTime;
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index 48f7894..c8013e6 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -14,11 +14,6 @@
#ifndef _TCLWINPORT
#define _TCLWINPORT
-#if !defined(_WIN64) && defined(BUILD_tcl)
-/* See [Bug 3354324]: file mtime sets wrong time */
-# define _USE_32BIT_TIME_T
-#endif
-
/*
* We must specify the lower version we intend to support.
*
@@ -31,6 +26,9 @@
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0501
#endif
+#ifndef __MSVCRT_VERSION__
+# define __MSVCRT_VERSION__ 0x0601
+#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -115,7 +113,6 @@ typedef DWORD_PTR * PDWORD_PTR;
#endif /* __MWERKS__ */
#include <time.h>
-
/*
* The following defines redefine the Windows Socket errors as
* BSD errors so Tcl_PosixError can do the right thing.