summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-02-15 14:28:47 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-02-15 14:28:47 (GMT)
commit66a15c6f8be47c3acbdddffadc67f50dec8a56e6 (patch)
treeedaf81ee6d40edeacc9f3e2093ddcb2ba302c620 /win
parent2827a2692798a7a0ec46e684a4ccc83afb39859e (diff)
downloadtcl-66a15c6f8be47c3acbdddffadc67f50dec8a56e6.zip
tcl-66a15c6f8be47c3acbdddffadc67f50dec8a56e6.tar.gz
tcl-66a15c6f8be47c3acbdddffadc67f50dec8a56e6.tar.bz2
TIP#72 implementation. See ChangeLog for details.
This version builds clean on Solaris/SPARC, with GCC and CC, both with and without threads and both in 32-bit and 64-bit mode.
Diffstat (limited to 'win')
-rw-r--r--win/Makefile.in4
-rw-r--r--win/makefile.bc2
-rw-r--r--win/makefile.vc4
-rw-r--r--win/tclWinChan.c36
-rw-r--r--win/tclWinFile.c30
-rw-r--r--win/tclWinMtherr.c8
-rw-r--r--win/tclWinPort.h13
7 files changed, 61 insertions, 36 deletions
diff --git a/win/Makefile.in b/win/Makefile.in
index 80dcb28..7e1eead 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -5,7 +5,7 @@
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
-# RCS: @(#) $Id: Makefile.in,v 1.58 2001/11/25 05:22:19 mdejong Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.59 2002/02/15 14:28:51 dkf Exp $
VERSION = @TCL_VERSION@
@@ -282,7 +282,7 @@ WIN_OBJS = \
tclWinTime.$(OBJEXT)
COMPAT_OBJS = \
- strftime.$(OBJEXT)
+ strftime.$(OBJEXT) strtoll.$(OBJEXT) strtoull.$(OBJEXT)
PIPE_OBJS = stub16.$(OBJEXT)
diff --git a/win/makefile.bc b/win/makefile.bc
index 8406a6e..ff1093b 100644
--- a/win/makefile.bc
+++ b/win/makefile.bc
@@ -175,6 +175,8 @@ TCLOBJS = \
$(TMPDIR)\regfree.obj \
$(TMPDIR)\regerror.obj \
$(TMPDIR)\strftime.obj \
+ $(TMPDIR)\strtoll.obj \
+ $(TMPDIR)\strtoull.obj \
$(TMPDIR)\tclAlloc.obj \
$(TMPDIR)\tclAsync.obj \
$(TMPDIR)\tclBasic.obj \
diff --git a/win/makefile.vc b/win/makefile.vc
index f990c1a..430671d 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -12,7 +12,7 @@
# Copyright (c) 2001 Tomasoft Engineering.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: makefile.vc,v 1.77 2002/01/11 20:07:23 davygrvy Exp $
+# RCS: @(#) $Id: makefile.vc,v 1.78 2002/02/15 14:28:51 dkf Exp $
#------------------------------------------------------------------------------
!if "$(MSVCDIR)" == ""
@@ -218,6 +218,8 @@ TCLOBJS = \
$(TMP_DIR)\regfree.obj \
$(TMP_DIR)\regerror.obj \
$(TMP_DIR)\strftime.obj \
+ $(TMP_DIR)\strtoll.obj \
+ $(TMP_DIR)\strtoul.obj
$(TMP_DIR)\tclAlloc.obj \
$(TMP_DIR)\tclAsync.obj \
$(TMP_DIR)\tclBasic.obj \
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 04830d9..52084a6 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinChan.c,v 1.19 2002/01/18 14:17:06 dgp Exp $
+ * RCS: @(#) $Id: tclWinChan.c,v 1.20 2002/02/15 14:28:51 dkf Exp $
*/
#include "tclWinInt.h"
@@ -89,8 +89,8 @@ static int FileInputProc _ANSI_ARGS_((ClientData instanceData,
char *buf, int toRead, int *errorCode));
static int FileOutputProc _ANSI_ARGS_((ClientData instanceData,
CONST char *buf, int toWrite, int *errorCode));
-static int FileSeekProc _ANSI_ARGS_((ClientData instanceData,
- long offset, int mode, int *errorCode));
+static Tcl_WideInt FileSeekProc _ANSI_ARGS_((ClientData instanceData,
+ Tcl_WideInt offset, int mode, int *errorCode));
static void FileSetupProc _ANSI_ARGS_((ClientData clientData,
int flags));
static void FileWatchProc _ANSI_ARGS_((ClientData instanceData,
@@ -431,17 +431,16 @@ FileCloseProc(instanceData, interp)
*----------------------------------------------------------------------
*/
-static int
+static Tcl_WideInt
FileSeekProc(instanceData, offset, mode, errorCodePtr)
- ClientData instanceData; /* File state. */
- long offset; /* Offset to seek to. */
- int mode; /* Relative to where
- * should we seek? */
- int *errorCodePtr; /* To store error code. */
+ ClientData instanceData; /* File state. */
+ Tcl_WideInt offset; /* Offset to seek to. */
+ int mode; /* Relative to where should we seek? */
+ int *errorCodePtr; /* To store error code. */
{
FileInfo *infoPtr = (FileInfo *) instanceData;
DWORD moveMethod;
- DWORD newPos;
+ DWORD newPos, newPosHigh;
*errorCodePtr = 0;
if (mode == SEEK_SET) {
@@ -452,13 +451,18 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
moveMethod = FILE_END;
}
- newPos = SetFilePointer(infoPtr->handle, offset, NULL, moveMethod);
- if (newPos == 0xFFFFFFFF) {
- TclWinConvertError(GetLastError());
- *errorCodePtr = errno;
- return -1;
+ newPosHigh = (DWORD)(offset >> 32);
+ newPos = SetFilePointer(infoPtr->handle, (LONG) offset, &newPosHigh,
+ moveMethod);
+ if (newPos == INVALID_SET_FILE_POINTER) {
+ int winError = GetLastError();
+ if (winError != NO_ERROR) {
+ TclWinConvertError(winError);
+ *errorCodePtr = errno;
+ return -1;
+ }
}
- return newPos;
+ return ((Tcl_WideInt) newPos) | (((Tcl_WideInt) newPosHigh) << 32);
}
/*
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index ae2776d..90feb0c 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinFile.c,v 1.25 2002/02/08 02:52:55 dgp Exp $
+ * RCS: @(#) $Id: tclWinFile.c,v 1.26 2002/02/15 14:28:51 dkf Exp $
*/
#include "tclWinInt.h"
@@ -31,7 +31,7 @@ typedef NET_API_STATUS NET_API_FUNCTION NETGETDCNAMEPROC
(LPWSTR servername, LPWSTR domainname, LPBYTE *bufptr);
static int NativeAccess(CONST TCHAR *path, int mode);
-static int NativeStat(CONST TCHAR *path, struct stat *statPtr);
+static int NativeStat(CONST TCHAR *path, Tcl_StatBuf *statPtr);
static int NativeIsExec(CONST TCHAR *path);
@@ -367,7 +367,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types)
}
}
if (typeOk && types->type != 0) {
- struct stat buf;
+ Tcl_StatBuf buf;
if (NativeStat(nativeName, &buf) != 0) {
/*
@@ -830,7 +830,7 @@ TclpGetCwd(interp, bufferPtr)
int
TclpObjStat(pathPtr, statPtr)
Tcl_Obj *pathPtr; /* Path of file to stat */
- struct stat *statPtr; /* Filled with results of stat call. */
+ Tcl_StatBuf *statPtr; /* Filled with results of stat call. */
{
#ifdef OLD_API
Tcl_Obj *transPtr;
@@ -883,7 +883,7 @@ TclpObjStat(pathPtr, statPtr)
static int
NativeStat(nativePath, statPtr)
CONST TCHAR *nativePath; /* Path of file to stat */
- struct stat *statPtr; /* Filled with results of stat call. */
+ Tcl_StatBuf *statPtr; /* Filled with results of stat call. */
{
Tcl_DString ds;
DWORD attr;
@@ -971,10 +971,11 @@ NativeStat(nativePath, statPtr)
attr = data.a.dwFileAttributes;
- statPtr->st_size = data.a.nFileSizeLow;
- statPtr->st_atime = ToCTime(data.a.ftLastAccessTime);
- statPtr->st_mtime = ToCTime(data.a.ftLastWriteTime);
- statPtr->st_ctime = ToCTime(data.a.ftCreationTime);
+ statPtr->st_size = ((Tcl_WideInt)data.a.nFileSizeLow) |
+ (((Tcl_WideInt)data.a.nFileSizeHigh) << 32);
+ statPtr->st_atime = ToCTime(data.a.ftLastAccessTime);
+ statPtr->st_mtime = ToCTime(data.a.ftLastWriteTime);
+ statPtr->st_ctime = ToCTime(data.a.ftCreationTime);
} else {
WIN32_FILE_ATTRIBUTE_DATA data;
if((*tclWinProcs->getFileAttributesExProc)(nativePath,
@@ -1031,10 +1032,11 @@ NativeStat(nativePath, statPtr)
attr = data.dwFileAttributes;
- statPtr->st_size = data.nFileSizeLow;
- statPtr->st_atime = ToCTime(data.ftLastAccessTime);
- statPtr->st_mtime = ToCTime(data.ftLastWriteTime);
- statPtr->st_ctime = ToCTime(data.ftCreationTime);
+ statPtr->st_size = ((Tcl_WideInt)data.nFileSizeLow) |
+ (((Tcl_WideInt)data.nFileSizeHigh) << 32);
+ statPtr->st_atime = ToCTime(data.ftLastAccessTime);
+ statPtr->st_mtime = ToCTime(data.ftLastWriteTime);
+ statPtr->st_ctime = ToCTime(data.ftCreationTime);
}
mode = (attr & FILE_ATTRIBUTE_DIRECTORY) ? S_IFDIR | S_IEXEC : S_IFREG;
@@ -1217,7 +1219,7 @@ TclpObjAccess(pathPtr, mode)
int
TclpObjLstat(pathPtr, buf)
Tcl_Obj *pathPtr;
- struct stat *buf;
+ Tcl_StatBuf *buf;
{
return TclpObjStat(pathPtr,buf);
}
diff --git a/win/tclWinMtherr.c b/win/tclWinMtherr.c
index 7be9b97..65896b8 100644
--- a/win/tclWinMtherr.c
+++ b/win/tclWinMtherr.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinMtherr.c,v 1.3 1999/04/16 00:48:09 stanton Exp $
+ * RCS: @(#) $Id: tclWinMtherr.c,v 1.4 2002/02/15 14:28:51 dkf Exp $
*/
#include "tclWinInt.h"
@@ -43,7 +43,11 @@ _matherr(xPtr)
if (!TclMathInProgress()) {
return 0;
}
- if ((xPtr->type == DOMAIN) || (xPtr->type == SING)) {
+ if ((xPtr->type == DOMAIN)
+#ifdef __BORLANDC__
+ || (xPtr->type == TLOSS)
+#endif
+ || (xPtr->type == SING)) {
errno = EDOM;
} else {
errno = ERANGE;
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index f27413e..193e366 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPort.h,v 1.25 2002/01/24 01:34:16 dgp Exp $
+ * RCS: @(#) $Id: tclWinPort.h,v 1.26 2002/02/15 14:28:51 dkf Exp $
*/
#ifndef _TCLWINPORT
@@ -468,6 +468,17 @@ typedef int TclpMutex;
#define TclpMutexUnlock(a)
#endif /* TCL_THREADS */
+#ifdef TCL_WIDE_INT_TYPE
+EXTERN Tcl_WideInt strtoll _ANSI_ARGS_((char *string, char **endPtr,
+ int base));
+EXTERN Tcl_WideUInt strtoull _ANSI_ARGS_((char *string, char **endPtr,
+ int base));
+#endif /* TCL_WIDE_INT_TYPE */
+
+#ifndef INVALID_SET_FILE_POINTER
+#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
+#endif
+
#include "tclPlatDecls.h"
#include "tclIntPlatDecls.h"